Skip to content

Understand at least one argument for non empty array unpacked#4134

Merged
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
VincentLanglet:fix/10020
Jul 21, 2025
Merged

Understand at least one argument for non empty array unpacked#4134
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
VincentLanglet:fix/10020

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

@VincentLanglet VincentLanglet commented Jul 20, 2025

];
}

if (count($arguments) === 0 && $type->isIterableAtLeastOnce()->yes()) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happen when the constant array is non-empty but all the keys are optional.

@ondrejmirtes ondrejmirtes merged commit 4941982 into phpstan:2.1.x Jul 21, 2025
414 of 419 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method ::load() invoked with 0 parameters, at least 1 required. Non empty array treated as empty when unpacking it as function arguments

2 participants