We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0aedd68 commit 243e4b2Copy full SHA for 243e4b2
src/Symfony/Bridge/Twig/DataCollector/TwigDataCollector.php
@@ -31,7 +31,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
31
private $twig;
32
private $computed;
33
34
- public function __construct(Profile $profile, Environment $twig)
+ public function __construct(Profile $profile, Environment $twig = null)
35
{
36
$this->profile = $profile;
37
$this->twig = $twig;
@@ -62,6 +62,10 @@ public function lateCollect()
62
$this->data['profile'] = serialize($this->profile);
63
$this->data['template_paths'] = array();
64
65
+ if (null === $this->twig) {
66
+ return;
67
+ }
68
+
69
$templateFinder = function (Profile $profile) use (&$templateFinder) {
70
if ($profile->isTemplate()) {
71
try {
0 commit comments