@@ -88,8 +88,7 @@ public function check(
88
88
$ hasNamedArguments = false ;
89
89
$ hasUnpackedArgument = false ;
90
90
$ errors = [];
91
- foreach ($ args as $ i => $ arg ) {
92
- $ type = $ scope ->getType ($ arg ->value );
91
+ foreach ($ args as $ arg ) {
93
92
if ($ hasNamedArguments && $ arg ->unpack ) {
94
93
$ errors [] = RuleErrorBuilder::message ('Named argument cannot be followed by an unpacked (...) argument. ' )
95
94
->identifier ('argument.unpackAfterNamed ' )
@@ -113,6 +112,7 @@ public function check(
113
112
$ argumentName = $ arg ->name ->toString ();
114
113
}
115
114
if ($ arg ->unpack ) {
115
+ $ type = $ scope ->getType ($ arg ->value );
116
116
$ arrays = $ type ->getConstantArrays ();
117
117
if (count ($ arrays ) > 0 ) {
118
118
$ minKeys = null ;
@@ -191,7 +191,7 @@ public function check(
191
191
192
192
if (!$ hasNamedArguments ) {
193
193
$ invokedParametersCount = count ($ arguments );
194
- foreach ($ arguments as $ i => [$ argumentValue , $ argumentValueType , $ unpack , $ argumentName ]) {
194
+ foreach ($ arguments as [$ argumentValue , $ argumentValueType , $ unpack , $ argumentName ]) {
195
195
if ($ unpack ) {
196
196
$ invokedParametersCount = max ($ functionParametersMinCount , $ functionParametersMaxCount );
197
197
break ;
0 commit comments