Commit 80059d6
committed
Generic/InlineControlStructure: remove unreachable if condition
Commit e1b9595 changed the
InlineControlStructure sniff to make it bail early for all control
structures without a body (before the sniff did that only for `while`
and `for`).
Before commit e1b9595, `$nextNonEmpty`
could be `false` as there were some scenarios where there would be no
non-empty tokens after the `$stackPtr` or after the `parenthesis_closer`.
This is the case for the `else` without a body in
InlineControlStructureUnitTest.2.inc and the `if` without a body in
InlineControlStructureUnitTest.5.inc.
After commit e1b9595, `$nextNonEmpty`
cannot be `false` anymore as cases where there are no non-empty tokens
are handled before this variable is set. This happens either in line 83
when `$nextTokenIndex` is set or line 98 when `$nextTokenIndex` is not
set (a control structure that is not `T_ELSE` or `T_DO` and is missing
the parenthesis closer).1 parent 960d09c commit 80059d6
File tree
1 file changed
+0
-4
lines changed- src/Standards/Generic/Sniffs/ControlStructures
1 file changed
+0
-4
lines changedLines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 118 | | |
123 | 119 | | |
124 | 120 | | |
| |||
0 commit comments