Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 28, 2025

extracted from #4372

}
return $variable->name;
}, $parameterVars);
$unusedParameters = array_combine($parameterNames, $parameterVars);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rewrite/simplifed this code, as it relied on array_combine which can return false on PHP7.4, which got caught by the MutatingScope improvement.

Argument of an invalid type array<string, PhpParser\Node\Expr\Variable>|false supplied for foreach, only iterables are supported.

rewrote it to get rid of the PHP 7.4 specific behaviour so I don't need to add 7.4 only ignores or similar hacks.

@staabm staabm marked this pull request as ready for review September 28, 2025 08:44
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 3b72271 into phpstan:2.1.x Sep 28, 2025
545 of 550 checks passed
@ondrejmirtes
Copy link
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.

3 participants