@@ -102,8 +102,7 @@ public function check(
102
102
$ hasNamedArguments = false ;
103
103
$ hasUnpackedArgument = false ;
104
104
$ errors = [];
105
- foreach ($ args as $ i => $ arg ) {
106
- $ type = $ scope ->getType ($ arg ->value );
105
+ foreach ($ args as $ arg ) {
107
106
if ($ hasNamedArguments && $ arg ->unpack ) {
108
107
$ errors [] = RuleErrorBuilder::message ('Named argument cannot be followed by an unpacked (...) argument. ' )
109
108
->identifier ('argument.unpackAfterNamed ' )
@@ -127,6 +126,7 @@ public function check(
127
126
$ argumentName = $ arg ->name ->toString ();
128
127
}
129
128
if ($ arg ->unpack ) {
129
+ $ type = $ scope ->getType ($ arg ->value );
130
130
$ arrays = $ type ->getConstantArrays ();
131
131
if (count ($ arrays ) > 0 ) {
132
132
$ maxKeys = null ;
@@ -211,7 +211,7 @@ public function check(
211
211
212
212
if (!$ hasNamedArguments ) {
213
213
$ invokedParametersCount = count ($ arguments );
214
- foreach ($ arguments as $ i => [$ argumentValue , $ argumentValueType , $ unpack , $ argumentName ]) {
214
+ foreach ($ arguments as [$ argumentValue , $ argumentValueType , $ unpack , $ argumentName ]) {
215
215
if ($ unpack ) {
216
216
$ invokedParametersCount = max ($ functionParametersMinCount , $ functionParametersMaxCount );
217
217
break ;
0 commit comments