Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit e4f3696

Browse files
committed
Allow Doctrine annotations v2
1 parent fa82b87 commit e4f3696

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"require": {
1414
"php": ">=7.2.5",
15-
"doctrine/annotations": "^1.0",
15+
"doctrine/annotations": "^1.0|^2.0",
1616
"symfony/config": "^4.4|^5.0|^6.0",
1717
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
1818
"symfony/framework-bundle": "^4.4|^5.0|^6.0",

tests/Routing/AnnotatedRouteControllerLoaderTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ public function testServiceOptionIsNotAllowedOnMethod()
110110
public function testLoad()
111111
{
112112
$loader = new AnnotatedRouteControllerLoader(new AnnotationReader());
113-
AnnotationRegistry::registerLoader('class_exists');
113+
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
114+
AnnotationRegistry::registerLoader('class_exists');
115+
}
114116

115117
$rc = $loader->load('Sensio\Bundle\FrameworkExtraBundle\Tests\Routing\Fixtures\FoobarController');
116118

@@ -135,7 +137,9 @@ public function testLoad()
135137
public function testInvokableControllerLoad()
136138
{
137139
$loader = new AnnotatedRouteControllerLoader(new AnnotationReader());
138-
AnnotationRegistry::registerLoader('class_exists');
140+
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
141+
AnnotationRegistry::registerLoader('class_exists');
142+
}
139143

140144
$rc = $loader->load('Sensio\Bundle\FrameworkExtraBundle\Tests\Routing\Fixtures\InvokableController');
141145

0 commit comments

Comments
 (0)