Skip to content

Commit

Permalink
Clean up CompleteMissingIfElseBracketRector (#5130)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 6, 2023
1 parent 0c9fac5 commit 3699f54
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -5,6 +5,7 @@
namespace Rector\CodeQuality\Rector\If_;

use PhpParser\Node;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Else_;
use PhpParser\Node\Stmt\ElseIf_;
use PhpParser\Node\Stmt\If_;
Expand Down Expand Up @@ -112,8 +113,7 @@ private function isIfConditionFollowedByOpeningCurlyBracket(If_|ElseIf_|Else_ $i
}

$startStmt = current($if->stmts);
$lastStmt = end($if->stmts);
return $startStmt === false || $lastStmt === false;
return ! $startStmt instanceof Stmt;
}

private function isBareNewNode(If_|ElseIf_|Else_ $if): bool
Expand Down

0 comments on commit 3699f54

Please sign in to comment.