Skip to content

Commit 09ad2f3

Browse files
authored
Merge pull request #170 from axi/master
Allows doctrine/annotations ^2.0
2 parents 174b7a4 + d54e9df commit 09ad2f3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"nikic/php-parser": "^3.0 || ^4.0",
1414
"symfony/finder": "^3.4 || ^4.4 || ^5.0 || ^6.0",
1515
"twig/twig": "^2.0 || ^3.0",
16-
"doctrine/annotations": "^1.7"
16+
"doctrine/annotations": "^1.7 || ^2.0"
1717
},
1818
"require-dev": {
1919
"symfony/phpunit-bridge": "^5.0 || ^6.0",

tests/bootstrap.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@
1313

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

16-
AnnotationRegistry::registerLoader('class_exists');
16+
if (!class_exists(AnnotationRegistry::class, false) && class_exists(AnnotationRegistry::class)) {
17+
if (method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
18+
AnnotationRegistry::registerUniqueLoader('class_exists');
19+
} elseif (method_exists(AnnotationRegistry::class, 'registerLoader')) {
20+
AnnotationRegistry::registerLoader('class_exists');
21+
}
22+
}

0 commit comments

Comments
 (0)