Repository navigation
PHPStan Rules 14.18.2
New Rules ✨
Add PreferGenericTemplateOnSameUnionTypeRule (#349)
Flags a method whose param and return share the same class-type union, e.g. (A|B $node): A|B|null. Such a method usually returns the passed node, so a @template generic narrows the return to the passed type. Registered in the rector-rules set.