Skip to content

Commit

Permalink
Prevent crash for Attribute class polyfill without constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 27, 2023
1 parent 81b8cc4 commit 9334ff3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,9 @@ private function findAttributeFlags(): ?int
$arguments[] = new Arg($expression, false, false, [], is_int($i) ? null : new Identifier($i));
}

if (!$attributeClass->hasConstructor()) {
return null;
}
$attributeConstructor = $attributeClass->getConstructor();
$attributeConstructorVariant = ParametersAcceptorSelector::selectSingle($attributeConstructor->getVariants());

Expand Down

0 comments on commit 9334ff3

Please sign in to comment.