Skip to content

Commit

Permalink
Merge pull request #170 from axi/master
Browse files Browse the repository at this point in the history
Allows doctrine/annotations ^2.0
  • Loading branch information
bocharsky-bw committed Mar 28, 2023
2 parents 174b7a4 + d54e9df commit 09ad2f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"nikic/php-parser": "^3.0 || ^4.0",
"symfony/finder": "^3.4 || ^4.4 || ^5.0 || ^6.0",
"twig/twig": "^2.0 || ^3.0",
"doctrine/annotations": "^1.7"
"doctrine/annotations": "^1.7 || ^2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^5.0 || ^6.0",
Expand Down
8 changes: 7 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@

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

AnnotationRegistry::registerLoader('class_exists');
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
AnnotationRegistry::registerUniqueLoader('class_exists');
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
AnnotationRegistry::registerLoader('class_exists');
}
}

0 comments on commit 09ad2f3

Please sign in to comment.