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

PreferPHPUnitSelfCallRector not part of any set #317

Closed
staabm opened this issue Mar 7, 2024 · 6 comments
Closed

PreferPHPUnitSelfCallRector not part of any set #317

staabm opened this issue Mar 7, 2024 · 6 comments

Comments

@staabm
Copy link
Contributor

staabm commented Mar 7, 2024

I wonder why the PreferPHPUnitSelfCallRector is not part of any setlist?

@samsonasik
Copy link
Member

iirc, the rule was configured to prefer using this or self, then seems changed to non configurable for change to self, which maybe make personal preference for call parent assert methods.

@staabm
Copy link
Contributor Author

staabm commented Mar 7, 2024

in phpunit the methods are declared as static, which leads to a endless number of phpstan errors, when using $this variants.

I don't think its a matter of taste.

@samsonasik
Copy link
Member

I recall that sebastian said calling this or via self is just equal, I checked on https://phpstan.org/r/ce3b2725-899d-4369-9502-b367dc90d2f6 and it seems green, it probably some phpstan extension that force it?

@samsonasik
Copy link
Member

ok, the notice shown when "strict rules" in phpstan demo clicked https://phpstan.org/r/12c7bd74-0e7f-4910-9fc5-c5b8be59ea06 , so probably still preference, since if strict rules not activated, it still working ok without notice.

@staabm
Copy link
Contributor Author

staabm commented Mar 7, 2024

hmm I see .. valid points.

@TomasVotruba
Copy link
Member

Indeed, this rule is to fit personal preference.

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

No branches or pull requests

3 participants