Prefer $this return type over static #7437
-
Hi there, We have a codebase where there are many Is there a recommendation for working with this scenario. *The rules used are: Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, the best way is to add rule that add what you don't want via On the other hand, the |
Beta Was this translation helpful? Give feedback.
Hi,
the best way is to add rule that add what you don't want via
skip()
method:https://github.com/rectorphp/rector/blob/main/docs/how_to_ignore_rule_or_paths.md
On the other hand, the
static
return type is far better than docblocks, as it give PHPStan and Rector 100 % confidence about type.So more rule can work with it and build on it :)