Skip to content

[DeadCode] Remove property comment same line on RemoveUnusedPrivatePropertyRector#3547

Merged
TomasVotruba merged 4 commits intomainfrom
close-3539
Apr 1, 2023
Merged

[DeadCode] Remove property comment same line on RemoveUnusedPrivatePropertyRector#3547
TomasVotruba merged 4 commits intomainfrom
close-3539

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 <markus.staab@redaxo.de>
Co-authored-by: GitHub Action <actions@github.com>
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