DDC-3956: Incorrect type-hinting in EntityRepository #4836

Closed
opened 2026-01-22 14:50:20 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Oct 20, 2015).

Originally assigned to: @Majkl578 on GitHub.

Jira issue originally created by user mindplay:

In the current ORM release, the $em argument in the constructor of EntityRepository isn't type-hinted - this makes our dependency injection container cry.

In the head of master, it's now type-hinted as EntityManagerInterface, so clearly somebody noticed this is an issue (?)

However, it's still inconsistent with the php-doc annotation, which says the argument type is EntityRepository.

Which one is correct?

Originally created by @doctrinebot on GitHub (Oct 20, 2015). Originally assigned to: @Majkl578 on GitHub. Jira issue originally created by user mindplay: In the current ORM release, the $em argument in the constructor of EntityRepository isn't type-hinted - this makes our dependency injection container cry. In the head of master, [it's now type-hinted as EntityManagerInterface](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L65), so clearly somebody noticed this is an issue (?) However, it's still inconsistent with the php-doc annotation, which says the argument type is EntityRepository. Which one is correct?
admin added the Bug label 2026-01-22 14:50:20 +01:00
admin closed this issue 2026-01-22 14:50:20 +01:00
Author
Owner

@Majkl578 commented on GitHub (Aug 30, 2017):

This was fixed by #6599.

@Majkl578 commented on GitHub (Aug 30, 2017): This was fixed by #6599.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4836