2121use PHPStan \Type \FloatType ;
2222use PHPStan \Type \IntegerRangeType ;
2323use PHPStan \Type \IntegerType ;
24- use PHPStan \Type \IntersectionType ;
2524use PHPStan \Type \MixedType ;
2625use PHPStan \Type \NullType ;
2726use PHPStan \Type \StringType ;
2827use PHPStan \Type \Type ;
29- use PHPStan \Type \UnionType ;
28+ use PHPStan \Type \TypeCombinator ;
3029use function is_int ;
3130use function sprintf ;
3231use function strtolower ;
@@ -161,7 +160,7 @@ public function getTypeFromFunctionCall(
161160 if ($ inputType ->isNonEmptyString ()->yes ()
162161 && $ type instanceof StringType
163162 && !$ this ->canStringBeSanitized ($ filterValue , $ flagsArg , $ scope )) {
164- $ type = new IntersectionType ([ $ type , new AccessoryNonEmptyStringType ()] );
163+ $ type = TypeCombinator:: intersect ( $ type , new AccessoryNonEmptyStringType ());
165164 }
166165
167166 if (isset ($ otherTypes ['range ' ])) {
@@ -183,7 +182,7 @@ public function getTypeFromFunctionCall(
183182 }
184183
185184 if (isset ($ otherTypes ['default ' ]) && $ otherTypes ['default ' ]->isSuperTypeOf ($ type )->no ()) {
186- $ type = new UnionType ([ $ type , $ otherTypes ['default ' ] ]);
185+ $ type = TypeCombinator:: union ( $ type , $ otherTypes ['default ' ]);
187186 }
188187
189188 if ($ this ->hasFlag ($ this ->getConstant ('FILTER_FORCE_ARRAY ' ), $ flagsArg , $ scope )) {
0 commit comments