Skip to content

Commit b164c7b

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

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rules/DeadCode/Rector/Stmt/RemoveNextSameValueConditionRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ public function refactor(Node $node): ?Node
9090
if (! $stmt instanceof If_) {
9191
continue;
9292
}
93+
9394
// only when no elseif/else in current if
9495
if ($stmt->elseifs !== []) {
9596
continue;
9697
}
98+
9799
if ($stmt->else instanceof Else_) {
98100
continue;
99101
}
@@ -115,10 +117,12 @@ public function refactor(Node $node): ?Node
115117
if (! $this->nodeComparator->areNodesEqual($stmt->cond, $nextStmt->cond)) {
116118
continue;
117119
}
120+
118121
// only when no elseif/else in next stmt
119122
if ($nextStmt->elseifs !== []) {
120123
continue;
121124
}
125+
122126
if ($nextStmt->else instanceof Else_) {
123127
continue;
124128
}

0 commit comments

Comments
 (0)