mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
EntityManagerInterface has no #3/$lockVersion param in find method #7189
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 @mvorisek on GitHub (Jul 27, 2023).
Bug Report
Summary
I have found this inconsistency during abstracting entity manager type declaration from EntityManager to EntityManagerInterface.
Current behavior
Currently, in 2.15.x, EntityManager has the following find method prototype: https://github.com/doctrine/orm/blob/v2.5.14/lib/Doctrine/ORM/EntityManager.php#L377 and no find method prototype in EntityManagerInterface.
Given:
it seems the entity manager does support $lockVersion param officially and a missing find method prototype (with #3/$lockVersion param) in EntityManagerInterface is a mistake.
Expected behavior
2.x EntityManagerInterface should declare find method with #3/$lockVersion param (as 3.x does).
@derrabus commented on GitHub (Jul 29, 2023):
This will break each and every userland implementation of the interface out there which is exactly why we won't add the parameter in a minor release.
@mvorisek commented on GitHub (Jul 29, 2023):
I understand the possible BC break, on the other side,
EntityManagerInterfacecannot be currently used to replaceEntityManagerimpl. type as it is incomplete.Can the
findmethod prototype be added as phpdoc above the interface to make both worlds happy?@derrabus commented on GitHub (Jul 30, 2023):
If that fixes your problem, why not.
@mvorisek commented on GitHub (Jul 30, 2023):
I was just about to add
@methodphpdoc, but how to specify templated return using@method?@ondrejmirtes is that possible with phpstan?