DDC-1893: Doctrine\ORM\Mapping\Driver\AnnotationDriver::create() not updated for new annotation readers #2386

Closed
opened 2026-01-22 13:51:23 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 26, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user vasekpurchart:

After refactoring of annotation readers, there are new defaults and the current implementation calls undefined method, because Doctrine\Common\Annotations\AnnotationReader has been refactored too. The new way should be probably requiring Doctrine\Common\Annotations\Reader interface as $reader parameter and if not present constructing the default as in Doctrine\ORM\Configuration::create :

AnnotationRegistry::registerFile(DIR . '/Mapping/Driver/DoctrineAnnotations.php');

$reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader();
$reader->addNamespace('Doctrine\ORM\Mapping');
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());

Originally created by @doctrinebot on GitHub (Jun 26, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user vasekpurchart: After refactoring of annotation readers, there are new defaults and the current implementation calls undefined method, because Doctrine\Common\Annotations\AnnotationReader has been refactored too. The new way should be probably requiring Doctrine\Common\Annotations\Reader interface as $reader parameter and if not present constructing the default as in Doctrine\ORM\Configuration::create : AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); $reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader(); $reader->addNamespace('Doctrine\ORM\Mapping'); $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
admin added the Bug label 2026-01-22 13:51:23 +01:00
admin closed this issue 2026-01-22 13:51:23 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 6, 2012):

Comment created by @ocramius:

Looking into this today

@doctrinebot commented on GitHub (Jul 6, 2012): Comment created by @ocramius: Looking into this today
Author
Owner

@doctrinebot commented on GitHub (Jul 6, 2012):

Comment created by @beberlei:

$config->newDefaultAnnotationDriver should have a flag for picking the simple or the "ORM" prefixed reader

@doctrinebot commented on GitHub (Jul 6, 2012): Comment created by @beberlei: $config->newDefaultAnnotationDriver should have a flag for picking the simple or the "ORM\" prefixed reader
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Comment created by @ocramius:

Handled in DDC-1915 (https://github.com/doctrine/doctrine2/pull/396)

@doctrinebot commented on GitHub (Jul 8, 2012): Comment created by @ocramius: Handled in [DDC-1915](http://www.doctrine-project.org/jira/browse/DDC-1915) (https://github.com/doctrine/doctrine2/pull/396)
Author
Owner

@doctrinebot commented on GitHub (Jul 8, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 8, 2012): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2386