You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The downgraded switch should not add a return to throw new Exception
Responsible rules
DowngradeMatchToSwitchRector
DowngradeThrowExprRector
Expected Behavior
public function run($param)
{
switch ($param) {
case 'a':
return 'hi';
case 'b':
return 'bye';
default:
- return throw new Exception('no salutation');+ throw new Exception('no salutation');
}
}
The text was updated successfully, but these errors were encountered:
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1ec2fda5-2490-6c56-9d12-93cf2aafeb8a
When there's a
throw new Exception
in thematch
, like here:The downgraded
switch
should not add areturn
tothrow new Exception
Responsible rules
DowngradeMatchToSwitchRector
DowngradeThrowExprRector
Expected Behavior
The text was updated successfully, but these errors were encountered: