When running PSR2.ControlStructures.SwitchDeclaration sniff fix on following code:
switch ($foo) {
case 1: $bar = 1; break;
case 2: $bar = 2; break;
case 21:
case 3: return 3;
default: $bar = 0;
}
the expected result should be
switch ($foo) {
case 1:
$bar = 1;
break;
case 2:
$bar = 2;
break;
case 21:
case 3:
return 3;
default:
$bar = 0;
}
but the actual result is messed up:
switch ($foo) {
case 1: $barbreak;
case 2: $barbreak;
case 21:
case 3return 3;
default: $bar = 0;
}
It seems the last few tokens before case end (be it break or return) are just removed.
I can supply this code to SwitchDeclarationUnitTest.inc and SwitchDeclarationUnitTest.inc.fixed respectively, however I am not sure I can come with actual PR to fix this.