[TwigBridge] Fix BC break due required twig environment
This commit is contained in:
parent
0aedd686dd
commit
243e4b2e2f
@ -31,7 +31,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
private $twig;
|
||||
private $computed;
|
||||
|
||||
public function __construct(Profile $profile, Environment $twig)
|
||||
public function __construct(Profile $profile, Environment $twig = null)
|
||||
{
|
||||
$this->profile = $profile;
|
||||
$this->twig = $twig;
|
||||
@ -62,6 +62,10 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
|
||||
$this->data['profile'] = serialize($this->profile);
|
||||
$this->data['template_paths'] = array();
|
||||
|
||||
if (null === $this->twig) {
|
||||
return;
|
||||
}
|
||||
|
||||
$templateFinder = function (Profile $profile) use (&$templateFinder) {
|
||||
if ($profile->isTemplate()) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user