Skip to content

Commit

Permalink
earlier $node->stmts check
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 13, 2023
1 parent 0a13118 commit 6d61b59
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ private function findCurrentScopeReturn(ClassMethod|Function_ $node): ?Return_
{
$return = null;

if ($node->stmts === null) {
return null;
}

$this->traverseNodesWithCallable($node->stmts, function (Node $node) use (&$return): ?int {
if (! $node instanceof Return_) {
return null;
Expand Down Expand Up @@ -194,6 +190,10 @@ private function shouldSkipNode(ClassMethod|Function_ $node): bool
return true;
}

if ($node->stmts === null) {
return true;
}

if ($node instanceof ClassMethod) {
if ($this->parentClassMethodTypeOverrideGuard->hasParentClassMethod($node)) {
return true;
Expand Down

0 comments on commit 6d61b59

Please sign in to comment.