diff --git a/src/bundle/DataCollector/TwigDataCollector.php b/src/bundle/DataCollector/TwigDataCollector.php index 848de31..559e837 100644 --- a/src/bundle/DataCollector/TwigDataCollector.php +++ b/src/bundle/DataCollector/TwigDataCollector.php @@ -17,14 +17,14 @@ class TwigDataCollector extends BaseCollector public function __construct( Profile $profile, Environment $environment, - private TemplatePathRegistryInterface $templatePathRegistry + private ?TemplatePathRegistryInterface $templatePathRegistry ) { parent::__construct($profile, $environment); } private function getTemplatePathRegistry(): TemplatePathRegistryInterface { - return $this->templatePathRegistry; + return $this->templatePathRegistry ??= unserialize($this->data['template_path_registry']); } #[\Override]