Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 23, 2022
1 parent 1371b3c commit bd2c436
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ private function doesLastStatementBreakFlow(If_ | ElseIf_ $node): bool
$lastStmt = end($node->stmts);

if ($lastStmt instanceof If_ && $lastStmt->else instanceof Else_) {
$next = $lastStmt->else->getAttribute(AttributeKey::NEXT_NODE);
return $next instanceof Stmt;
return $this->doesLastStatementBreakFlow($lastStmt);
}

return ! ($lastStmt instanceof Return_
Expand Down

0 comments on commit bd2c436

Please sign in to comment.