Skip to content

Commit 42a67ac

Browse files
committed
[ci-review] Rector Rectify
1 parent 2c27d00 commit 42a67ac

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

rules/DeadCode/Rector/Stmt/RemoveNextSameValueConditionRector.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ public function refactor(Node $node): ?Node
9090
if (! $stmt instanceof If_) {
9191
continue;
9292
}
93-
9493
// only when no elseif/else in current if
95-
if ($stmt->elseifs !== [] || $stmt->else instanceof Else_) {
94+
if ($stmt->elseifs !== []) {
95+
continue;
96+
}
97+
if ($stmt->else instanceof Else_) {
9698
continue;
9799
}
98100

@@ -113,9 +115,11 @@ public function refactor(Node $node): ?Node
113115
if (! $this->nodeComparator->areNodesEqual($stmt->cond, $nextStmt->cond)) {
114116
continue;
115117
}
116-
117118
// only when no elseif/else in next stmt
118-
if ($nextStmt->elseifs !== [] || $nextStmt->else instanceof Else_) {
119+
if ($nextStmt->elseifs !== []) {
120+
continue;
121+
}
122+
if ($nextStmt->else instanceof Else_) {
119123
continue;
120124
}
121125

0 commit comments

Comments
 (0)