-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#7173Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | dev-main |
I found two bugs, which I have given examples of below. I don't know if it is necessary to split this into 2 issue
Minimal PHP Code Causing Issue
<?php
final class DemoFile
{
public function run($name): string
{
switch ($name) {
case 'a':
return 'A';
case 'b':
return 'C';
case 'd':
case 'c':
case 'f':
default:
return 'C';
}
}
}<?php
final class DemoFile
{
public function run($name): string
{
switch ($item) {
case 'a':
case 'b':
return 'val1';
case 'c':
return 'val2';
case 'd':
case 'e':
return 'val5';
case 'f':
case 'g':
case 'h':
return 'val2';
case 'i':
return 'val3';
}
}
}Expected Behaviour
First example:
<?php
final class DemoFile
{
public function run($name): string
{
switch ($name) {
case 'a':
return 'A';
case 'b':
case 'd':
case 'c':
case 'f':
default:
return 'C';
}
}
}Second example:
<?php
final class DemoFile
{
public function run($name): string
{
switch ($item) {
case 'a':
case 'b':
return 'val1';
case 'c':
case 'f':
case 'g':
case 'h':
return 'val2';
case 'd':
case 'e':
return 'val5';
case 'i':
return 'val3';
}
}
}Reactions are currently unavailable