File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,17 @@ public function getTypeFromMethodCall(
36
36
}
37
37
38
38
$ argType = $ scope ->getType ($ methodCall ->args [0 ]->value );
39
- if (!$ argType instanceof ConstantBooleanType) {
40
- return ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ())->getReturnType ();
39
+ $ isTrueType = (new ConstantBooleanType (true ))->isSuperTypeOf ($ argType );
40
+ $ isFalseType = (new ConstantBooleanType (false ))->isSuperTypeOf ($ argType );
41
+ $ compareTypes = $ isTrueType ->compareTo ($ isFalseType );
42
+ if ($ compareTypes === $ isTrueType ) {
43
+ return new ResourceType ();
44
+ }
45
+ if ($ compareTypes === $ isFalseType ) {
46
+ return new StringType ();
41
47
}
42
48
43
- return $ argType -> getValue () ? new ResourceType () : new StringType ();
49
+ return ParametersAcceptorSelector:: selectSingle ( $ methodReflection -> getVariants ())-> getReturnType ();
44
50
}
45
51
46
52
}
You can’t perform that action at this time.
0 commit comments