Skip to content

Commit 2eb2e0c

Browse files
committed
Catch Doctrine\Persistence\Mapping\MappingException too
1 parent 753f9e8 commit 2eb2e0c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Doctrine/Mapping/MappingDriverChain.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata): void
3030
try {
3131
$driver->loadMetadataForClass($className, $metadata);
3232
return;
33-
} catch (MappingException | AnnotationException $e) {
33+
} catch (\Doctrine\Persistence\Mapping\MappingException | MappingException | AnnotationException $e) {
3434
// pass
3535
}
3636
}
@@ -60,7 +60,7 @@ public function isTransient($className)
6060
}
6161

6262
return false;
63-
} catch (MappingException | AnnotationException $e) {
63+
} catch (\Doctrine\Persistence\Mapping\MappingException | MappingException | AnnotationException $e) {
6464
// pass
6565
}
6666
}

src/Rules/Doctrine/ORM/EntityMappingExceptionRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function processNode(Node $node, Scope $scope): array
5555

5656
try {
5757
$objectManager->getClassMetadata($className);
58-
} catch (MappingException | AnnotationException $e) {
58+
} catch (\Doctrine\Persistence\Mapping\MappingException | MappingException | AnnotationException $e) {
5959
return [$e->getMessage()];
6060
}
6161

src/Type/Doctrine/GetRepositoryDynamicReturnTypeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getTypeFromMethodCall(
110110

111111
try {
112112
$repositoryClass = $this->getRepositoryClass($objectName, $defaultRepositoryClass);
113-
} catch (MappingException | AnnotationException $e) {
113+
} catch (\Doctrine\Persistence\Mapping\MappingException | MappingException | AnnotationException $e) {
114114
return $this->getDefaultReturnType($scope, $methodCall->getArgs(), $methodReflection, $defaultRepositoryClass);
115115
}
116116

src/Type/Doctrine/ObjectMetadataResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getClassMetadata(string $className): ?ClassMetadataInfo
111111
} else {
112112
$metadata = $objectManager->getClassMetadata($className);
113113
}
114-
} catch (MappingException | AnnotationException $e) {
114+
} catch (\Doctrine\Persistence\Mapping\MappingException | MappingException | AnnotationException $e) {
115115
return null;
116116
}
117117

0 commit comments

Comments
 (0)