Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EntityManagerInterface extends deprecated Doctrine\Common\Persistence\ObjectManager #7955

@vanoostrum

Description

@vanoostrum

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

  1. 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.
  2. Use the class Doctrine\ORM\EntityManagerInterface to trigger the classloader to load the class.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions