Skip to content

[CodeQuality] Unpack the arguments array in SingleWithConsecutiveToWithRector - #851

Merged
TomasVotruba merged 1 commit into
mainfrom
single-with-consecutive-unpack-args
Dec 2, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
single-with-consecutive-unpack-args

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

withConsecutive() takes one array of arguments per call, with() takes the arguments themselves. SingleWithConsecutiveToWithRector passed the array through as is, so the mock then expected a single array argument:

-->withConsecutive([1])
-->with([1])
+->with(1)

The array items now become the with() arguments, a non-literal array is spread (->with(...$arguments)), and an array with keys or by-reference items is skipped.

…thRector, with() takes the arguments themselves
@TomasVotruba
TomasVotruba force-pushed the single-with-consecutive-unpack-args branch from 30b9d5d to bdd7df4 Compare December 2, 2026 11:02
@TomasVotruba
TomasVotruba merged commit a725a09 into main Dec 2, 2026
15 checks passed
@TomasVotruba
TomasVotruba deleted the single-with-consecutive-unpack-args branch December 2, 2026 11:04
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