Skip to content

Fix RemoveDuplicatedCaseInSwitchRector behavior#7173

Merged
samsonasik merged 3 commits intorectorphp:mainfrom
mspirkov:fix-remove-duplicated-case-in-switch
Aug 25, 2025
Merged

Fix RemoveDuplicatedCaseInSwitchRector behavior#7173
samsonasik merged 3 commits intorectorphp:mainfrom
mspirkov:fix-remove-duplicated-case-in-switch

Conversation

@mspirkov
Copy link
Contributor

@mspirkov mspirkov commented Aug 25, 2025

Closes: rectorphp/rector#9329

In this PR, I fixed the behavior of RemoveDuplicatedCaseInSwitchRector. The existing algorithm seemed very complicated to me, and I couldn't fix it, so I wrote a new one.
I hope I haven't missed any test cases. I would appreciate any suggestions for adding test cases.

Copy link
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 , let's give it a try

@samsonasik samsonasik merged commit bda2d3c into rectorphp:main Aug 25, 2025
54 of 55 checks passed
@samsonasik
Copy link
Member

Thank you @max-s-lab

@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect behavior of RemoveDuplicatedCaseInSwitchRector

2 participants