Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeadCode] Add RemoveDeadConditionAboveReturnRector #5194

Merged
merged 14 commits into from
Jan 15, 2021
Merged

Conversation

samsonasik
Copy link
Member

Fixes #4925

@samsonasik samsonasik changed the title [DeadCode][WIP] Add RemoveDeadConditionAboveReturnRector [DeadCode] Add RemoveDeadConditionAboveReturnRector Jan 15, 2021
Comment on lines +9 to +13
if (1 === 1) {
return 'yes';
}

return 'yes';
Copy link
Member

Choose a reason for hiding this comment

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

I see. This case should be covered too, right?

-if (1 === 'hey') {
-    return 'yes';
-}

 return 'yes';

Copy link
Member Author

Choose a reason for hiding this comment

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

the check is not in the cond of if, but on its stmt, so that's already covered.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added new fixture 08a197f for different cond

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit ac677c9 into master Jan 15, 2021
@TomasVotruba TomasVotruba deleted the fix-4925 branch January 15, 2021 19:16
@TomasVotruba
Copy link
Member

Thank you 👍

TomasVotruba added a commit that referenced this pull request Oct 23, 2023
rectorphp/rector-src@3e505e5 add fixture for only importNames() without removeUnusedIMpotrs() (#5194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DeadCode] Remove dead condition above return anyway
2 participants