-
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
Add type hint for entity manager #1482
Conversation
Looks good, but I've previously had a similar change rejected for being a backwards-compatibility break. (Which is technically is, even if it only breaks code that's already pretty broken.) |
@DHager Could we use ObjectRepository interface for type hint? |
@bocharsky-bw EntityManager is not an ObjectRepository at all and this change is wrong as it forbids to pass other implementations of EntityManagerInterface |
@stof Sorry, I don't know how could I wrote this. |
We don't accept any object manager here. It must be an entity manager |
Could we use |
Yes |
@beberlei I think it will be clearer, won't it? In PHP we have type hint for objects and it's a good practice to use it I think. Also it will help to find bugs on initial level. |
👍 |
Accepting the change, I thought a bit about possible BC breaks, but PHP doesn't care about constructor override signature changes. |
Add type hint for entity manager
👍 |
No description provided.