Skip to content

Commit

Permalink
Merge pull request #568 from soltmar/2.0
Browse files Browse the repository at this point in the history
[FIX] Silence Passing null to class_exists() deprecation warning
  • Loading branch information
eigan authored Oct 26, 2023
2 parents ab656aa + c3e368f commit 1789dac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Middleware/SubstituteBindings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 1789dac

Please sign in to comment.