File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,17 @@ public function getTypeFromMethodCall(
3636 }
3737
3838 $ 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 ();
4147 }
4248
43- return $ argType -> getValue () ? new ResourceType () : new StringType ();
49+ return ParametersAcceptorSelector:: selectSingle ( $ methodReflection -> getVariants ())-> getReturnType ();
4450 }
4551
4652}
You can’t perform that action at this time.
0 commit comments