Bug Report
| Subject |
Details |
| Rector version |
2.6.7 |
Hi,
the rule SingularSwitchToIfRector does not work with multiple break statements.
If a switch has only one case but one case uses multiple break statements the rule will only remove the last break statement and leave the others.
Change results in:
Fatal error: 'break' not in the 'loop' or 'switch' context in
Best regards
Minimal PHP Code Causing Issue
https://getrector.com/demo/536962e6-04c9-4406-9bc4-09c8b38810a8
Expected Behaviour
No change
Bug Report
Hi,
the rule SingularSwitchToIfRector does not work with multiple break statements.
If a switch has only one case but one case uses multiple break statements the rule will only remove the last break statement and leave the others.
Change results in:
Fatal error: 'break' not in the 'loop' or 'switch' context inBest regards
Minimal PHP Code Causing Issue
https://getrector.com/demo/536962e6-04c9-4406-9bc4-09c8b38810a8
Expected Behaviour
No change