Skip to content

Commit f2b357c

Browse files
authored
Merge branch refs/heads/1.12.x into 2.0.x
2 parents de0553c + 2d64686 commit f2b357c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rules/FunctionCallParametersCheck.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ public function check(
102102
$hasNamedArguments = false;
103103
$hasUnpackedArgument = false;
104104
$errors = [];
105-
foreach ($args as $i => $arg) {
106-
$type = $scope->getType($arg->value);
105+
foreach ($args as $arg) {
107106
if ($hasNamedArguments && $arg->unpack) {
108107
$errors[] = RuleErrorBuilder::message('Named argument cannot be followed by an unpacked (...) argument.')
109108
->identifier('argument.unpackAfterNamed')
@@ -127,6 +126,7 @@ public function check(
127126
$argumentName = $arg->name->toString();
128127
}
129128
if ($arg->unpack) {
129+
$type = $scope->getType($arg->value);
130130
$arrays = $type->getConstantArrays();
131131
if (count($arrays) > 0) {
132132
$maxKeys = null;
@@ -211,7 +211,7 @@ public function check(
211211

212212
if (!$hasNamedArguments) {
213213
$invokedParametersCount = count($arguments);
214-
foreach ($arguments as $i => [$argumentValue, $argumentValueType, $unpack, $argumentName]) {
214+
foreach ($arguments as [$argumentValue, $argumentValueType, $unpack, $argumentName]) {
215215
if ($unpack) {
216216
$invokedParametersCount = max($functionParametersMinCount, $functionParametersMaxCount);
217217
break;

0 commit comments

Comments
 (0)