Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf30750

Browse filesBrowse files
committed
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
2 parents 3bf89b6 + ef7122e commit cf30750
Copy full SHA for cf30750

File tree

2 files changed

+3
-8
lines changed
Filter options

2 files changed

+3
-8
lines changed

‎src/Symfony/Bridge/Twig/Extension/DumpExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/DumpExtension.php
+2-7Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/composer.json
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.