Skip to content

Commit 5eed42b

Browse files
committed
Do not crash when asking isTransient about class that doesn't have runtime reflection
1 parent 65146e3 commit 5eed42b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Rules/Doctrine/ORM/EntityColumnRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ public function processNode(Node $node, Scope $scope): array
6464
}
6565

6666
$className = $class->getName();
67-
if ($objectManager->getMetadataFactory()->isTransient($className)) {
67+
try {
68+
if ($objectManager->getMetadataFactory()->isTransient($className)) {
69+
return [];
70+
}
71+
} catch (\ReflectionException $e) {
6872
return [];
6973
}
7074

src/Rules/Doctrine/ORM/EntityRelationRule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public function processNode(Node $node, Scope $scope): array
4848
}
4949

5050
$className = $class->getName();
51-
if ($objectManager->getMetadataFactory()->isTransient($className)) {
51+
try {
52+
if ($objectManager->getMetadataFactory()->isTransient($className)) {
53+
return [];
54+
}
55+
} catch (\ReflectionException $e) {
5256
return [];
5357
}
5458

0 commit comments

Comments
 (0)