You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For 7.0 the protected $container property was typed as ContainerInterface, this leads to an error when using it together with the LazyGhost as it tries to access the property before it is initialized.
How to reproduce
Extend the AbstractController, configure it in the container as lazy and with the setContainer method
Possible Solution
Catch the exception, and set null as fallback:
Before:
Can you please provide a small reproducer?
This might be caused by php/php-src#12695
Is your controller lazy? That shouldn't be needed I think (but that doesn't invalidate the issue)
Symfony version(s) affected
7.0
Description
For 7.0 the protected
$container
property was typed asContainerInterface
, this leads to an error when using it together with theLazyGhost
as it tries to access the property before it is initialized.How to reproduce
Extend the AbstractController, configure it in the container as lazy and with the
setContainer
methodPossible Solution
Catch the exception, and set null as fallback:
Before:
After:
I tried to use isset instead of null coalesce, but that leads to memory issues, so i guess catching the exception would be best
Additional Context
See stack trace:
The text was updated successfully, but these errors were encountered: