Skip to content

Commit

Permalink
Only one call to $parameter->getType()
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Dec 1, 2020
1 parent 2bb4b62 commit c5ad0db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Mappers/RequestParameterMiddleware.php
Expand Up @@ -18,7 +18,8 @@ class RequestParameterMiddleware implements ParameterMiddlewareInterface

public function mapParameter(ReflectionParameter $parameter, DocBlock $docBlock, ?Type $paramTagType, ParameterAnnotations $parameterAnnotations, ParameterHandlerInterface $next): ParameterInterface
{
if ($parameter->getType() and $parameter->getType()->getName() === Request::class) {
$parameterType = $parameter->getType();
if ($parameterType && $parameterType->getName() === Request::class) {
return new RequestParameter();
}
return $next->mapParameter($parameter, $docBlock, $paramTagType, $parameterAnnotations);
Expand Down

0 comments on commit c5ad0db

Please sign in to comment.