1818use  PHPStan \Type \BooleanType ;
1919use  PHPStan \Type \CallableType ;
2020use  PHPStan \Type \Constant \ConstantIntegerType ;
21- use  PHPStan \Type \ErrorType ;
2221use  PHPStan \Type \Generic \TemplateType ;
2322use  PHPStan \Type \Generic \TemplateTypeMap ;
2423use  PHPStan \Type \IntegerType ;
@@ -90,7 +89,7 @@ public static function selectFromArgs(
9089$ parameters$ acceptorgetParameters ();
9190$ callbackParameters
9291foreach  ($ arrayMapArgsas  $ arg
93- $ callbackParametersnew  DummyParameter ('item ' , self :: getIterableValueType ($ scopegetType ($ argvalue )), false , PassedByReference::createNo (), false , null );
92+ $ callbackParametersnew  DummyParameter ('item ' , $ scope -> getIterableValueType ($ scopegetType ($ argvalue )), false , PassedByReference::createNo (), false , null );
9493}
9594$ parameters0 ] = new  NativeParameterReflection (
9695$ parameters0 ]->getName (),
@@ -151,12 +150,12 @@ public static function selectFromArgs(
151150if  ($ modeinstanceof  ConstantIntegerType) {
152151if  ($ modegetValue () === ARRAY_FILTER_USE_KEY ) {
153152$ arrayFilterParameters
154- new  DummyParameter ('key ' , self :: getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
153+ new  DummyParameter ('key ' , $ scope -> getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
155154];
156155} elseif  ($ modegetValue () === ARRAY_FILTER_USE_BOTH ) {
157156$ arrayFilterParameters
158- new  DummyParameter ('item ' , self :: getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
159- new  DummyParameter ('key ' , self :: getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
157+ new  DummyParameter ('item ' , $ scope -> getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
158+ new  DummyParameter ('key ' , $ scope -> getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
160159];
161160}
162161}
@@ -169,7 +168,7 @@ public static function selectFromArgs(
169168$ parameters1 ]->isOptional (),
170169new  CallableType (
171170$ arrayFilterParameters
172- new  DummyParameter ('item ' , self :: getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
171+ new  DummyParameter ('item ' , $ scope -> getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
173172],
174173new  MixedType (),
175174false ,
@@ -191,8 +190,8 @@ public static function selectFromArgs(
191190
192191if  (isset ($ args0 ]) && (bool ) $ args0 ]->getAttribute (ArrayWalkArgVisitor::ATTRIBUTE_NAME )) {
193192$ arrayWalkParameters
194- new  DummyParameter ('item ' , self :: getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createReadsArgument (), false , null ),
195- new  DummyParameter ('key ' , self :: getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
193+ new  DummyParameter ('item ' , $ scope -> getIterableValueType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createReadsArgument (), false , null ),
194+ new  DummyParameter ('key ' , $ scope -> getIterableKeyType ($ scopegetType ($ args0 ]->value )), false , PassedByReference::createNo (), false , null ),
196195];
197196if  (isset ($ args2 ])) {
198197$ arrayWalkParametersnew  DummyParameter ('arg ' , $ scopegetType ($ args2 ]->value ), false , PassedByReference::createNo (), false , null );
@@ -548,44 +547,6 @@ private static function wrapParameter(ParameterReflection $parameter): Parameter
548547);
549548}
550549
551- private  static  function  getIterableValueType (Type $ typeType 
552- {
553- if  ($ typeinstanceof  UnionType) {
554- $ types
555- foreach  ($ typegetTypes () as  $ innerType
556- $ iterableValueType$ innerTypegetIterableValueType ();
557- if  ($ iterableValueTypeinstanceof  ErrorType) {
558- continue ;
559- }
560- 
561- $ types$ iterableValueType
562- }
563- 
564- return  TypeCombinator::union (...$ types
565- }
566- 
567- return  $ typegetIterableValueType ();
568- }
569- 
570- private  static  function  getIterableKeyType (Type $ typeType 
571- {
572- if  ($ typeinstanceof  UnionType) {
573- $ types
574- foreach  ($ typegetTypes () as  $ innerType
575- $ iterableKeyType$ innerTypegetIterableKeyType ();
576- if  ($ iterableKeyTypeinstanceof  ErrorType) {
577- continue ;
578- }
579- 
580- $ types$ iterableKeyType
581- }
582- 
583- return  TypeCombinator::union (...$ types
584- }
585- 
586- return  $ typegetIterableKeyType ();
587- }
588- 
589550private  static  function  getCurlOptValueType (int  $ curlOptType 
590551{
591552if  (defined ('CURLOPT_SSL_VERIFYHOST ' ) && $ curlOptCURLOPT_SSL_VERIFYHOST ) {
0 commit comments