Skip to content

Commit

Permalink
Merge branch refs/heads/1.12.x into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot authored Dec 16, 2024
2 parents de0553c + 2d64686 commit f2b357c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Rules/FunctionCallParametersCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ public function check(
$hasNamedArguments = false;
$hasUnpackedArgument = false;
$errors = [];
foreach ($args as $i => $arg) {
$type = $scope->getType($arg->value);
foreach ($args as $arg) {
if ($hasNamedArguments && $arg->unpack) {
$errors[] = RuleErrorBuilder::message('Named argument cannot be followed by an unpacked (...) argument.')
->identifier('argument.unpackAfterNamed')
Expand All @@ -127,6 +126,7 @@ public function check(
$argumentName = $arg->name->toString();
}
if ($arg->unpack) {
$type = $scope->getType($arg->value);
$arrays = $type->getConstantArrays();
if (count($arrays) > 0) {
$maxKeys = null;
Expand Down Expand Up @@ -211,7 +211,7 @@ public function check(

if (!$hasNamedArguments) {
$invokedParametersCount = count($arguments);
foreach ($arguments as $i => [$argumentValue, $argumentValueType, $unpack, $argumentName]) {
foreach ($arguments as [$argumentValue, $argumentValueType, $unpack, $argumentName]) {
if ($unpack) {
$invokedParametersCount = max($functionParametersMinCount, $functionParametersMaxCount);
break;
Expand Down

0 comments on commit f2b357c

Please sign in to comment.