-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Mark ServiceEntityRepository as lazy #1600
Conversation
I just realized that lazy services are not compatible with final classes, so this might break some apps that aggressively make their repositories final. |
Was that working before? |
Not really: the creation of the circular graph required double instantiations. This was mostly unnoticed but could still lead to strange situations where two different objects could be created (and passed to dependents) for the same service. |
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.
Can we have a test for this?
That sounds to me like proxying final repositories before was working before, but it could result in different instances. Did I get it right? If this issue wasn't a downside of #1599, what was a downside of that solution? |
Proxying final classes works only when there is an interface to rely on. That's not the case for repositories so this never worked. |
Ok let's go with #1599 |
Replaces #1599
Fixes symfony/symfony#48666
See symfony/symfony#48666 (comment) for details.