Skip to content

Commit 3ee046d

Browse files
committed
AnnotationReader does not always exist
1 parent 6fc5407 commit 3ee046d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Doctrine/Mapping/ClassMetadataFactory.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ protected function initialize(): void
1919
$driverProperty = $parentReflection->getProperty('driver');
2020
$driverProperty->setAccessible(true);
2121

22-
$drivers = [
23-
new AnnotationDriver(new AnnotationReader()),
24-
];
22+
$drivers = [];
23+
if (class_exists(AnnotationReader::class)) {
24+
$drivers[] = new AnnotationDriver(new AnnotationReader());
25+
}
2526
if (class_exists(AttributeDriver::class) && PHP_VERSION_ID >= 80000) {
2627
$drivers[] = new AttributeDriver([]);
2728
}

0 commit comments

Comments
 (0)