Skip to content

Commit 8f3ee04

Browse files
nicolas-grekasfabpot
authored andcommitted
[TwigBundle/DebugBundle] move dump extension & cleanups
1 parent 30328b0 commit 8f3ee04

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Dumper/AbstractDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function dump(Data $data, $output = null)
115115
*/
116116
protected function dumpLine($depth)
117117
{
118-
call_user_func($this->lineDumper, $this->line, $depth);
118+
call_user_func($this->lineDumper, $this->line, $depth, $this->indentPad);
119119
$this->line = '';
120120
}
121121

@@ -125,10 +125,10 @@ protected function dumpLine($depth)
125125
* @param string $line The line to write.
126126
* @param int $depth The recursive depth in the dumped structure.
127127
*/
128-
protected function echoLine($line, $depth)
128+
protected function echoLine($line, $depth, $indentPad)
129129
{
130130
if (-1 !== $depth) {
131-
fwrite($this->outputStream, str_repeat($this->indentPad, $depth).$line."\n");
131+
fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n");
132132
}
133133
}
134134
}

Dumper/HtmlDumper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ class HtmlDumper extends CliDumper
5151
*/
5252
public function setOutput($output)
5353
{
54-
$this->headerIsDumped = false;
54+
if ($output !== $prev = parent::setOutput($output)) {
55+
$this->headerIsDumped = false;
56+
}
5557

56-
return parent::setOutput($output);
58+
return $prev;
5759
}
5860

5961
/**

0 commit comments

Comments
 (0)