Skip to content

Commit

Permalink
Remove fallbacks for old doctrine/annotations version (#9235)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Dec 11, 2021
1 parent 92434f9 commit 68fa55f
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions tests/Doctrine/Tests/OrmTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,12 @@ abstract class OrmTestCase extends DoctrineTestCase
/** @var Cache|null */
protected $secondLevelCacheDriverImpl = null;

/**
* @param mixed $alias
*/
protected function createAnnotationDriver(array $paths = [], $alias = null): AnnotationDriver
protected function createAnnotationDriver(array $paths = []): AnnotationDriver
{
// Register the ORM Annotations in the AnnotationRegistry
$reader = new Annotations\AnnotationReader();

if (class_exists(Annotations\PsrCachedReader::class)) {
$reader = new Annotations\PsrCachedReader($reader, new ArrayAdapter());
} else {
$reader = new Annotations\CachedReader($reader, DoctrineProvider::wrap(new ArrayAdapter()));
}

Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../../../lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');

return new AnnotationDriver($reader, (array) $paths);
return new AnnotationDriver(
new Annotations\PsrCachedReader(new Annotations\AnnotationReader(), new ArrayAdapter()),
$paths
);
}

/**
Expand Down

0 comments on commit 68fa55f

Please sign in to comment.