-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use EntityManagerInterface
in type declarations
#9325
Conversation
3aa4393
to
ba16229
Compare
I think @beberlei had a plan to kill that interface, not sure if this is the right move but I think he needs to review this. |
ba16229
to
c0f353f
Compare
@beberlei Do you have input on that topic? |
We introduced the interface to help with the use of The problem is in a decoration, code like Its a hard problem, it seems some people want to extend/decorate the EM for whatever reason, but its not a good solution for us. We could just give up and recommend extending |
So your plan would be to get rid of the interface (and consequently the abstract decorator) completely? That would generate the harder migration path for applications. Especially in Symfony applications, it is common to type-hint I agree that decorating the entity manager is not really a good way of extending the ORM. But at this point, I'd keep the interface tbh. |
c0f353f
to
a0eef2d
Compare
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.
Probably a wishful thinking of me, but yeah it would have been nice. But you are right, we should just go with the interface now. 👍 from me then. One question, i would remove the trait and inline the code into AbstractIdGenerator
, unless I am not seeing something.
2d4827c
to
23f30ea
Compare
23f30ea
to
6f1d171
Compare
6f1d171
to
be2924f
Compare
* 2.11.x: Use EntityManagerInterface in type declarations (doctrine#9325) Add errors caused by the lexer update to the baselines (doctrine#9360) Generated/Virtual Columns: Insertable / Updateable (doctrine#9118) Remove the composer/package-versions-deprecated package Relax assertion to include null as possible outcome (doctrine#9355)
The codebase inconsitently switched between
EntityManagerInterface
andEntityManager
in type declarations. This will get us into trouble if we want to migrate to native type declarations on 3.0.This PR switches all type declarations to
EntityManagerInterface
where possible.