Skip to content

Commit d63d901

Browse files
committed
Fix tests for 7.4
1 parent 0a70cb2 commit d63d901

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Functions.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,16 @@ private static function matchParamType(\ReflectionParameter $param, string $targ
574574
return $targetArgType === 'mixed';
575575
}
576576

577-
return (string) $paramType === ltrim($targetArgType, '\\');
577+
$targetArgType = ltrim($targetArgType, '\\');
578+
579+
if (PHP_MAJOR_VERSION === 7) {
580+
/** @psalm-suppress UndefinedMethod */
581+
$paramTypeName = $paramType->getName();
582+
$paramType->allowsNull() and $paramTypeName = "?{$paramTypeName}";
583+
584+
return $paramTypeName === $targetArgType;
585+
}
586+
587+
return (string) $paramType === $targetArgType;
578588
}
579589
}

0 commit comments

Comments
 (0)