Skip to content

[TypeDeclaration] Skip variadic param in AddMethodCallBasedStrictParamTypeRector#8123

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-variadic-strict-param-type
Jun 30, 2026
Merged

[TypeDeclaration] Skip variadic param in AddMethodCallBasedStrictParamTypeRector#8123
TomasVotruba merged 1 commit into
mainfrom
skip-variadic-strict-param-type

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jun 30, 2026

Copy link
Copy Markdown
Member

Variadic params received a strict type that belongs to a single element, not the whole spread array:

-private function createQueryBuilder(...$returnValues): MockObject
+private function createQueryBuilder(string ...$returnValues): MockObject

The resolved type comes from individual passed args, so applying it to the variadic param is wrong. Skip variadic params in ClassMethodParamTypeCompleter.

@TomasVotruba TomasVotruba enabled auto-merge (squash) June 30, 2026 12:04
@TomasVotruba TomasVotruba merged commit 7a27aad into main Jun 30, 2026
65 checks passed
@TomasVotruba TomasVotruba deleted the skip-variadic-strict-param-type branch June 30, 2026 12:05
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