Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 26, 2023
1 parent ba046d4 commit 42b8344
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ private function matchResponseExpr(Expr $expr): ?Expr
return null;
}

$varType = $this->nodeTypeResolver->getType($expr->var);
if (! $varType instanceof \PHPStan\Type\ObjectType) {
return null;
}

if (! $varType->isInstanceof('Symfony\Component\HttpFoundation\Response')->yes()) {
return null;
}

// must be status method call
if (! $this->isName($expr->name, 'getStatusCode')) {
return null;
Expand Down

0 comments on commit 42b8344

Please sign in to comment.