8000 bug #24851 [TwigBridge] Fix BC break due required twig environment (r… · symfony/symfony@69b48d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69b48d0

Browse files
bug #24851 [TwigBridge] Fix BC break due required twig environment (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #24851). Discussion ---------- [TwigBridge] Fix BC break due required twig environment | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes/no | Fixed tickets | #24236 (comment) | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> See ezsystems/ezplatform-design-engine#12 + silexphp/Silex-WebProfiler#126 + bolt/bolt#7154 Sorry for that :) cc @fabpot Commits ------- 243e4b2 [TwigBridge] Fix BC break due required twig environment
2 parents 88f228b + 243e4b2 commit 69b48d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
3131
private $twig;
3232
private $computed;
3333

34-
public function __construct(Profile $profile, Environment $twig)
34+
public function __construct(Profile $profile, Environment $twig = null)
3535
{
3636
$this->profile = $profile;
3737
$this->twig = $twig;
@@ -62,6 +62,10 @@ public function lateCollect()
6262
$this->data['profile'] = serialize($this->profile);
6363
$this->data['template_paths'] = array();
6464

65+
if (null === $this->twig) {
66+
return;
67+
}
68+
6569
$templateFinder = function (Profile $profile) use (&$templateFinder) {
6670
if ($profile->isTemplate()) {
6771
try {

0 commit comments

Comments
 (0)
0