-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Bug Report
| Q | A |
|---|---|
| BC Break | no |
| Version | 2.7.0 |
Summary
When the classloader loads Doctrine\ORM\EntityManagerInterface a 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\ObjectManager is deprecated in favor of \Doctrine\Persistence\ObjectManager.
Doctrine\ORM\EntityManagerInterface however still extends Doctrine\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
- Make sure composer will install Doctrine ORM version 2.7.0, without specifying a specific version of Doctrine\Persistence. Composer should install Doctrine Persistence version 1.3.3.
- Use the class
Doctrine\ORM\EntityManagerInterfaceto trigger the classloader to load the class. - Notice the deprecation warning: "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."
Expected behavior
The class should be loaded with no deprecation warning.