Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicate…
…dCaseInSwitchRector (#5239) * [DeadCode] Handle repetitive jump equal case stmts on RemoveDuplicatedCaseInSwitchRector * Fixed 🎉 * fix missing-in-set config * fix @return * clean up
- Loading branch information
1 parent
eac58be
commit 2f74b02
Showing
3 changed files
with
78 additions
and
39 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...Switch_/RemoveDuplicatedCaseInSwitchRector/Fixture/different_indirect_duplicated3.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector\Fixture; | ||
|
||
class DiffrentIndirectDuplicated3 | ||
{ | ||
public function run($name) | ||
{ | ||
switch ($name) { | ||
case 'a': | ||
return 'A'; | ||
case 'b': | ||
return 'B'; | ||
case 'c'; | ||
return 'C'; | ||
case 'd': | ||
return 'A'; | ||
case 'e': | ||
return 'B'; | ||
case 'f': | ||
return 'C'; | ||
case 'g': | ||
return 'A'; | ||
case 'h': | ||
return 'B'; | ||
case 'i': | ||
return 'C'; | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector\Fixture; | ||
|
||
class DiffrentIndirectDuplicated3 | ||
{ | ||
public function run($name) | ||
{ | ||
switch ($name) { | ||
case 'a': | ||
case 'd': | ||
case 'g': | ||
return 'A'; | ||
case 'b': | ||
case 'e': | ||
case 'h': | ||
return 'B'; | ||
case 'c': | ||
case 'f': | ||
case 'i': | ||
return 'C'; | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters