-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add ContainerEntityListenerResolver + load listeners lazy by default #951
Conversation
Maybe add a test that the deprecation is raised? |
@alcaeus should we test this? I think you said its not needed? |
I don't think it's necessary: the deprecation is dropped anyways and left for the |
Ready for another round of reviews. Also tested it again with my large work project and it works fine 😊 |
I guess you guys talked about that, but can you involve others in your decision to deprecate whole class, instead of relaxing __construct typehint in existing class? |
Relaxing the type hint from the Symfony |
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.
This looks good, great work @dmaicher!
sprintf('Lazy-loaded entity listeners can only be resolved by a resolver implementing %s.', $interface) | ||
); | ||
// if the resolver uses the default class we will use a service locator for all listeners | ||
if ($resolverClass === ContainerEntityListenerResolver::class) { |
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'd like to get rid of this logic for 2.0, but for now this is perfectly fine 👍
I would say old name would fit this change too, since it's still aware of container, just not the main one. But yeah I don't mind |
Thanks @dmaicher! 🎉 |
EUFOSSA
This implements #899
ContainerAwareEntityListenerResolver
intoContainerEntityListenerResolver
+ deprecate old classlazy
tag attribute specified)I tested this on my huge work project which uses Symfony 3.4 and we have 3 entity listeners: