Skip to content

Commit

Permalink
Fix set-up of annotation reader
Browse files Browse the repository at this point in the history
  • Loading branch information
W0rma committed Jul 31, 2024
1 parent fb8678e commit d0a84e4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

require __DIR__.'/../vendor/autoload.php';

if (class_exists('Doctrine\Common\Annotations\AnnotationReader')) {
if (class_exists(\Doctrine\Common\Annotations\AnnotationReader::class)) {
if (method_exists(\Doctrine\Common\Annotations\AnnotationRegistry::class, 'class_exists')) {
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
}
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
if (class_exists('Doctrine\Common\Cache\ArrayCache')) {
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ArrayCache());
if (class_exists(\Doctrine\Common\Cache\ArrayCache::class)) {
if (class_exists(\Doctrine\Common\Annotations\CachedReader::class)) {
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ArrayCache());
} else {
$reader = new \Doctrine\Common\Annotations\PsrCachedReader(
$reader,
\Doctrine\Common\Cache\Psr6\CacheAdapter::wrap(new \Doctrine\Common\Cache\ArrayCache()),
);
}
}
} else {
$reader = null;
Expand Down

0 comments on commit d0a84e4

Please sign in to comment.