rectorphp / rector-phpunit

Rector upgrade rules for PHPUnit
http://getrector.com
MIT License
61 stars 46 forks source link

PreferPHPUnitSelfCallRector not part of any set #317

Closed staabm closed 4 months ago

staabm commented 4 months ago

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

samsonasik commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

hmm I see .. valid points.

TomasVotruba commented 4 months ago

Indeed, this rule is to fit personal preference.