Skip to content

Commit

Permalink
Micro optimizations: cheap checks first (#4510)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 14, 2023
1 parent a12242d commit baa3943
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node
{
$returnType = $node->getReturnType();

if ($returnType === null) {
return null;
}

if ($node instanceof ClassMethod && $this->classMethodReturnTypeOverrideGuard->shouldSkipClassMethod(
$node,
$scope
)) {
return null;
}

if ($returnType === null) {
return null;
}

if (! $this->phpDocNestedAnnotationGuard->isPhpDocCommentCorrectlyParsed($node)) {
return null;
}
Expand Down

0 comments on commit baa3943

Please sign in to comment.