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] Remove property comment same line on RemoveUnusedPrivatePropertyRector #3547

Merged
merged 4 commits into from
Apr 1, 2023

Conversation

samsonasik
Copy link
Member

Closes #3539

@samsonasik
Copy link
Member Author

@staabm this is a quick solution, the general solution probably on the removeNode() process, but that will make it require next node attribute usage

@samsonasik
Copy link
Member Author

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

@samsonasik
Copy link
Member Author

samsonasik commented Apr 1, 2023

@staabm another general solution is probably create a dedicated rector rule to verify the Stmt just removed with next is Nop in the same line, eg: RemoveJustRemovedSameLineCommentStmtRemovedRector

that will work on usage on other rule as well :)

@staabm
Copy link
Contributor

staabm commented Apr 1, 2023

Thanks for working on it.

I can't tell which works best for rector. I have no experience with Nop AST nodes either.

@samsonasik
Copy link
Member Author

I will create alternative PR for it 👍

@samsonasik
Copy link
Member Author

Checking stmt just removed in loop of StmtsAwareInterface probably make memory hog as it will compare object in array, so probably not best solution.

@samsonasik
Copy link
Member Author

@staabm I created alternative PR for it, nevertheles #3548

@TomasVotruba TomasVotruba merged commit 53f549d into main Apr 1, 2023
@TomasVotruba TomasVotruba deleted the close-3539 branch April 1, 2023 19:26
samsonasik added a commit that referenced this pull request May 8, 2023
…opertyRector (#3547)

Co-authored-by: Markus Staab <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
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.

4 participants