Skip to content

RemoveSetterOnlyPropertyAndMethodRector and UnusedPrivatePropertyRector fixes#2293

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
jeroensmit:RemoveSetterOnlyFixes
Nov 8, 2019
Merged

RemoveSetterOnlyPropertyAndMethodRector and UnusedPrivatePropertyRector fixes#2293
TomasVotruba merged 1 commit intorectorphp:masterfrom
jeroensmit:RemoveSetterOnlyFixes

Conversation

@jeroensmit
Copy link
Copy Markdown
Contributor

Once again got a little out of hand.

Bugs fixed:

  • static property accessing using $this was not recognized
  • removing assigns also removed logic from the left side
  • variable property names are only relevant when used in read context
  • rectors couldn't handle multiple properties in 1 declaration

Both rectors now share the same logic.

The old way RemoveSetterOnlyPropertyAndMethodRector turned out to be rather slow on our codebase (30x slower than all other rectors). This in now fixed.

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you! 👍

New test fixtures makes this quite easy to review

@TomasVotruba TomasVotruba self-requested a review November 8, 2019 22:06
@TomasVotruba TomasVotruba merged commit a864dd7 into rectorphp:master Nov 8, 2019
TomasVotruba added a commit that referenced this pull request May 11, 2022
rectorphp/rector-src@1026ede Remove requires from tests, as all tests run on PHP 8.1 (#2293)
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.

2 participants