diff --git a/src/Middleware/SubstituteBindings.php b/src/Middleware/SubstituteBindings.php index a6b08d0c..af9ad31d 100644 --- a/src/Middleware/SubstituteBindings.php +++ b/src/Middleware/SubstituteBindings.php @@ -112,12 +112,11 @@ private function signatureParameters(Route $route) */ private function getClassName(ReflectionParameter $parameter): ?string { - $class = null; - if (($type = $parameter->getType()) && $type instanceof \ReflectionNamedType && !$type->isBuiltin()) { $class = $type->getName(); + return class_exists($class) ? $class : null; } - return class_exists($class) ? $class : null; + return null; } }