Skip to content

Commit

Permalink
[3.4] Fix support for PHP8 union types
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jun 18, 2020
1 parent 0db90db commit f64adec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Normalizer/AbstractNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ protected function denormalizeParameter(\ReflectionClass $class, \ReflectionPara
try {
if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) {
$parameterClass = $parameterClass->name;
} elseif (\PHP_VERSION_ID >= 70100 && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
} elseif (\PHP_VERSION_ID >= 70100 && ($parameterType = $parameter->getType()) instanceof \ReflectionNamedType && !$parameterType->isBuiltin()) {
$parameterClass = $parameterType->getName();
new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist
} else {
Expand Down

0 comments on commit f64adec

Please sign in to comment.