minor #19624 [Bridge/Twig] Simplify dumping snippet (nicolas-grekas)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[Bridge/Twig] Simplify dumping snippet

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | needs #19623
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

ef7122e [Bridge/Twig] Simplify dumping snippet
This commit is contained in:
Fabien Potencier 2016-08-16 10:16:30 -07:00
commit cf307507ee
2 changed files with 3 additions and 8 deletions

View File

@ -69,16 +69,11 @@ class DumpExtension extends \Twig_Extension
}
$dump = fopen('php://memory', 'r+b');
$prevOutput = $this->dumper->setOutput($dump);
foreach ($vars as $value) {
$this->dumper->dump($this->cloner->cloneVar($value));
$this->dumper->dump($this->cloner->cloneVar($value), $dump);
}
$this->dumper->setOutput($prevOutput);
rewind($dump);
return stream_get_contents($dump);
return stream_get_contents($dump, -1, 0);
}
}

View File

@ -33,7 +33,7 @@
"symfony/security-acl": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/var-dumper": "~2.8.9|~3.0.9|~3.1.3|~3.2",
"symfony/var-dumper": "~2.8.10|~3.1.4|~3.2",
"symfony/expression-language": "~2.8|~3.0"
},
"suggest": {