Skip to content
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

Dynamic return type for EntityManager#merge #16

Merged
merged 2 commits into from
Dec 1, 2017

Conversation

stesie
Copy link
Contributor

@stesie stesie commented Dec 1, 2017

Dynamically determine the return type of EntityManager#merge.

The merge function takes a single argument, the entity object to re-attach with the EM. It passes back a managed copy of the entity, hence the return type is type of first argument.

@ondrejmirtes
Copy link
Member

Hi, thank you for the patch, but this really cannot be in EntityManagerGetRepositoryDynamicReturnTypeExtension.php. Please create and register a separate extension :)

@stesie
Copy link
Contributor Author

stesie commented Dec 1, 2017

oh my, ... I haven't noticed the GetRepository part in the class name, I've just looked for the EntityManager being selected in getClass() and looked no further.

Sorry for that, will follow up within shortly

@stesie stesie force-pushed the entity-manager-merge branch from b56955f to bf3bb15 Compare December 1, 2017 14:09
@stesie
Copy link
Contributor Author

stesie commented Dec 1, 2017

here we go :-)

@ondrejmirtes
Copy link
Member

I just realized that depending on ObjectManager would be better, see #15 😊

@stesie
Copy link
Contributor Author

stesie commented Dec 1, 2017

good point, since it's declared on the interface.

fixed :)

@ondrejmirtes ondrejmirtes merged commit c534c1d into phpstan:master Dec 1, 2017
@ondrejmirtes
Copy link
Member

Thank you 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants