Skip to content

Commit 888d48a

Browse files
bootstrap.php: call registerLoader only if the method exists
1 parent 980fa76 commit 888d48a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/App/bootstrap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
$loader = require __DIR__.'/../../vendor/autoload.php';
1717

18-
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
18+
// This method only exist on doctrine/annotations:^1.3,
19+
// it is missing but not needed with doctrine/annotations:^2.0
20+
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
21+
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
22+
}
1923

2024
return $loader;

0 commit comments

Comments
 (0)