mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
EntityManagerInterface extends deprecated Doctrine\Common\Persistence\ObjectManager #6367
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 @vanoostrum on GitHub (Dec 16, 2019).
Bug Report
Summary
When the classloader loads
Doctrine\ORM\EntityManagerInterfacea deprecation warning is triggered stating: "The Doctrine\Common\Persistence\ObjectManager class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\ObjectManager instead."Current behavior
Doctrine ORM 2.7.0 requires the library doctrine/persistence: ^1.2 in its composer.json. This will resolve to doctrine/persistence 1.3.3 being installed.
In this version
Doctrine\Common\Persistence\ObjectManageris deprecated in favor of\Doctrine\Persistence\ObjectManager.Doctrine\ORM\EntityManagerInterfacehowever still extendsDoctrine\Common\Persistence\ObjectManager. This results in a deprecation warning when the class is loaded.Note: Deprecated code is potentially being used in other places in the Doctrine\ORM Library. This should be fixed as soon as possible.
How to reproduce
Doctrine\ORM\EntityManagerInterfaceto trigger the classloader to load the class.Expected behavior
The class should be loaded with no deprecation warning.
@lcobucci commented on GitHub (Dec 16, 2019):
We consider deprecation messages as warnings in the ORM and to solve these ones we'd have to bump
doctrine/persistencerequirement up to^1.3.3(v2.7.xdepends on^1.2) and we don't perform this operation in patch releases (only minor).We'll be addressing this for ORM v2.8 (#7953 already handles this).
@mhujer commented on GitHub (Dec 20, 2019):
For those interested, here is the related PR in Doctrine ORM repository https://github.com/doctrine/orm/pull/7953
@vanoostrum commented on GitHub (Jan 7, 2020):
@lcobucci Thanks for the explanation. It's a clear argument. We will be awaiting the next version. Until then we can avoid the deprecation warning by overriding the version in our own composer.json files.
I will close the issue because the deprecation will be resolved in a future release.