Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bundle/DataCollector/TwigDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is serializing and unserializing services a common pattern in Symfony Data Collectors?

}

#[\Override]
Expand Down
Loading