Skip to content

Commit ef7122e

Browse files
[Bridge/Twig] Simplify dumping snippet
1 parent 77e0161 commit ef7122e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Symfony/Bridge/Twig/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
}

src/Symfony/Bridge/Twig/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy