-
Notifications
You must be signed in to change notification settings - Fork 0
IBX-10341: Fixed accessing templatePathRegistry property in TwigDataCollector::getTemplatePathRegistry #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ollector::getTemplatePathRegistry https://issues.ibexa.co/browse/IBX-10341
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferably, in that case, I'd see here some unit test mocking serialization behavior, to see what contents is stored in $this->data.
| private function getTemplatePathRegistry(): TemplatePathRegistryInterface | ||
| { | ||
| return $this->templatePathRegistry; | ||
| return $this->templatePathRegistry ??= unserialize($this->data['template_path_registry']); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this is the current state of code, but really serialization should not be used for Data Collector purposes.
Every data collector I checked was extracting only the data it was capable of displaying in the profiler. Serialization of a whole service instance will bloat the profiler record, especially if registry is decorated.



Description:
Fixes bug - accessing property before initialization introduced in #38
For QA:
Documentation: