Navigation Menu

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 RemoveDeadInstanceOfRector #5470

Merged
merged 13 commits into from Feb 9, 2021
Merged

[DeadCode] Add RemoveDeadInstanceOfRector #5470

merged 13 commits into from Feb 9, 2021

Conversation

samsonasik
Copy link
Member

Fixes #5458

@samsonasik samsonasik changed the title [DeadCode] [WIP] Add RemoveDeadInstanceOfRector [DeadCode] Add RemoveDeadInstanceOfRector Feb 9, 2021
@samsonasik
Copy link
Member Author

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

@TomasVotruba
Copy link
Member

See \Rector\Core\Rector\AbstractTemporaryRector::unwrapStmts() for unwrapping many stmts

-if (...) {
   $stmt;
   $stmt2;
-}

@samsonasik
Copy link
Member Author

implemented with unwrapStmts()

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

public function run(If_ $var)
{
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

I love how you made it advanced with sub types 👏

@TomasVotruba
Copy link
Member

Thanks

@TomasVotruba TomasVotruba merged commit 31ceccc into master Feb 9, 2021
@TomasVotruba TomasVotruba deleted the fix-5458 branch February 9, 2021 13:31
TomasVotruba added a commit that referenced this pull request Jan 15, 2024
rectorphp/rector-src@5a3a59c Remove collectors, as performance very costly and not practically useful (#5470)
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 check exact value instanceof on type hinted ClassMethod
2 participants