Skip to content

Commit 9f9f501

Browse files
authored
Ensure registerLoader method exists on AnnotationReader
`registerLoader` method doesn't exist anymore. We must still check for older versions.
1 parent f33382a commit 9f9f501

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Config/Parser/AnnotationParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function getAnnotationReader(): Reader
4646
throw new ServiceNotFoundException("In order to use annotations, you need to install 'symfony/cache' first. See: 'https://symfony.com/doc/current/components/cache.html'");
4747
}
4848

49-
if (class_exists(AnnotationRegistry::class)) {
49+
if (class_exists(AnnotationRegistry::class) && method_exists(AnnotationRegistry::class, 'registerLoader')) {
5050
AnnotationRegistry::registerLoader('class_exists');
5151
}
5252
$cacheKey = md5(__DIR__);

0 commit comments

Comments
 (0)