Skip to content

Commit 1900d29

Browse files
[Bridge/Twig] Simplify dumping snippet
1 parent 8e22453 commit 1900d29

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Extension/DumpExtension.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,11 @@ public function dump(\Twig_Environment $env, $context)
6969
}
7070

7171
$dump = fopen('php://memory', 'r+b');
72-
$prevOutput = $this->dumper->setOutput($dump);
7372

7473
foreach ($vars as $value) {
75-
$this->dumper->dump($this->cloner->cloneVar($value));
74+
$this->dumper->dump($this->cloner->cloneVar($value), $dump);
7675
}
7776

78-
$this->dumper->setOutput($prevOutput);
79-
80-
rewind($dump);
81-
82-
return stream_get_contents($dump);
77+
return stream_get_contents($dump, -1, 0);
8378
}
8479
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"symfony/security-acl": "~2.8|~3.0",
3434
"symfony/stopwatch": "~2.8|~3.0",
3535
"symfony/console": "~2.8|~3.0",
36-
"symfony/var-dumper": "~2.8.9|~3.0.9|~3.1.3|~3.2",
36+
"symfony/var-dumper": "~2.8.10|~3.1.4|~3.2",
3737
"symfony/expression-language": "~2.8|~3.0"
3838
},
3939
"suggest": {

0 commit comments

Comments
 (0)