Skip to content

Add generic template to same param-return union methods - #406

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-generic-template-methods
Oct 12, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-generic-template-methods

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Satisfies the new PreferGenericTemplateOnSameUnionTypeRule (symplify/phpstan-rules).

Three methods take a node-type union param and return the same union - they return the passed node, so a @template generic now narrows the return type to the passed one. Docblocks only, no behavior change.

…turn union

Narrows the return type to the passed node type via @template. Satisfies the new PreferGenericTemplateOnSameUnionTypeRule from symplify/phpstan-rules.
@TomasVotruba
TomasVotruba merged commit a011960 into main Oct 12, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the tv-generic-template-methods branch October 12, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant