Merge branch '3.4' into 4.4

* 3.4:
  Fix
This commit is contained in:
Nicolas Grekas 2020-06-18 21:38:14 +02:00
commit 172d6400e3

View File

@ -45,10 +45,10 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
*/ */
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function): ?string private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function): ?string
{ {
if (!($type = $parameter->getType()) instanceof \ReflectionNamedType) { if (!$type = $parameter->getType()) {
return null; return null;
} }
$name = $type->getName(); $name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
if ($function instanceof \ReflectionMethod) { if ($function instanceof \ReflectionMethod) {
$lcName = strtolower($name); $lcName = strtolower($name);