Skip to content

Commit

Permalink
[TypeDeclaration][Performance] Check typed param already early on Par…
Browse files Browse the repository at this point in the history
…amTypeByMethodCallTypeRector (#5295)
  • Loading branch information
samsonasik committed Nov 28, 2023
1 parent 118fbde commit 765b636
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ static function (Node $node) {

private function shouldSkipParam(Param $param, ClassMethod $classMethod): bool
{
if (! $this->paramTypeAddGuard->isLegal($param, $classMethod)) {
// already has type, skip
if ($param->type !== null) {
return true;
}

if ($param->variadic) {
return true;
}

// already has type, skip
return $param->type !== null;
return ! $this->paramTypeAddGuard->isLegal($param, $classMethod);
}
}

0 comments on commit 765b636

Please sign in to comment.