File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 7
7
use PHPStan \Analyser \Scope ;
8
8
use PHPStan \Reflection \FunctionReflection ;
9
9
use PHPStan \Reflection \ReflectionProvider ;
10
+ use PHPStan \Type \Accessory \AccessoryNonEmptyStringType ;
10
11
use PHPStan \Type \ArrayType ;
11
12
use PHPStan \Type \BooleanType ;
12
13
use PHPStan \Type \Constant \ConstantArrayType ;
17
18
use PHPStan \Type \ErrorType ;
18
19
use PHPStan \Type \FloatType ;
19
20
use PHPStan \Type \IntegerType ;
21
+ use PHPStan \Type \IntersectionType ;
20
22
use PHPStan \Type \MixedType ;
21
23
use PHPStan \Type \NullType ;
22
24
use PHPStan \Type \StringType ;
@@ -128,6 +130,10 @@ public function getTypeFromFunctionCall(
128
130
$ type = $ this ->getFilterTypeMap ()[$ filterValue ] ?? $ mixedType ;
129
131
$ otherType = $ this ->getOtherType ($ flagsArg , $ scope );
130
132
133
+ if ($ inputType ->isNonEmptyString ()->yes ()) {
134
+ $ type = new IntersectionType ([$ type , new AccessoryNonEmptyStringType ()]);
135
+ }
136
+
131
137
if ($ otherType ->isSuperTypeOf ($ type )->no ()) {
132
138
$ type = new UnionType ([$ type , $ otherType ]);
133
139
}
You can’t perform that action at this time.
0 commit comments