10000 [TwigBridge] Fix BC break due required twig environment · symfony/symfony@243e4b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 243e4b2

Browse files
ro0NLnicolas-grekas
authored andcommitted
[TwigBridge] Fix BC break due required twig environment
1 parent 0aedd68 commit 243e4b2

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