Skip to content

Commit 9334ff3

Browse files
committed
Prevent crash for Attribute class polyfill without constructor
1 parent 81b8cc4 commit 9334ff3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/Reflection/ClassReflection.php

+3
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,9 @@ private function findAttributeFlags(): ?int
11511151
$arguments[] = new Arg($expression, false, false, [], is_int($i) ? null : new Identifier($i));
11521152
}
11531153

1154+
if (!$attributeClass->hasConstructor()) {
1155+
return null;
1156+
}
11541157
$attributeConstructor = $attributeClass->getConstructor();
11551158
$attributeConstructorVariant = ParametersAcceptorSelector::selectSingle($attributeConstructor->getVariants());
11561159

0 commit comments

Comments
 (0)