Skip to content

Commit b1506ef

Browse files
authored
Clean up ternary on ColonAfterSwitchCaseRector (#7158)
1 parent eda7704 commit b1506ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rules/Php85/Rector/Switch_/ColonAfterSwitchCaseRector.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ public function refactor(Node $node): ?Node
6565
continue;
6666
}
6767

68-
$startCaseStmtsPos = count($case->stmts) === 0
69-
? (
70-
isset($node->cases[$key + 1])
68+
if (count($case->stmts) === 0) {
69+
$startCaseStmtsPos = isset($node->cases[$key + 1])
7170
? $node->cases[$key + 1]->getStartTokenPos()
72-
: $node->getEndTokenPos()
73-
)
74-
: $case->stmts[0]->getStartTokenPos();
71+
: $node->getEndTokenPos();
72+
} else {
73+
$startCaseStmtsPos = $case->stmts[0]->getStartTokenPos();
74+
}
7575

7676
if ($startCaseStmtsPos < 0) {
7777
continue;

0 commit comments

Comments
 (0)