mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
EntityManagerInterface is missing getRepository definition #6335
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AngelsDustz on GitHub (Nov 5, 2019).
Originally assigned to: @Ocramius on GitHub.
Hello, we have some strict type checking on our PHP code and PHPStan noticed that I wrongly assigned a variable.
Upon further investigation I noticed that
EntityManagerInterface->getRepositoryhas a different specified return type thanEntityManager->getRepository.The non-interface has the following return annotation:
ObjectRepository|EntityRepository(https://www.doctrine-project.org/api/orm/latest/Doctrine/ORM/EntityManager.html#method_getRepository)But the interface does not have this function defined and defaults to the inherited
ObjectManager->getRepositoryresulting in a return type ofObjectRepository.@Ocramius commented on GitHub (Nov 5, 2019):
This is correct and expected