@@ -41,15 +41,16 @@ public function isFunctionSupported(FunctionReflection $functionReflection): boo
4141 public function getTypeFromFunctionCall (FunctionReflection $ functionReflection , FuncCall $ functionCall , Scope $ scope ): Type
4242 {
4343 $ args = $ functionCall ->getArgs ();
44+ $ defaultReturn = ParametersAcceptorSelector::selectSingle ($ functionReflection ->getVariants ())->getReturnType ();
4445
4546 if (\count ($ args ) < 2 ) {
46- return ParametersAcceptorSelector:: selectSingle ( $ functionReflection -> getVariants ())-> getReturnType () ;
47+ return $ defaultReturn ;
4748 }
4849
4950 $ queryReflection = new QueryReflection ();
5051 $ queryString = $ queryReflection ->resolveQueryString ($ args [1 ]->value , $ scope );
5152 if (null === $ queryString ) {
52- return ParametersAcceptorSelector:: selectSingle ( $ functionReflection -> getVariants ())-> getReturnType () ;
53+ return $ defaultReturn ;
5354 }
5455
5556 $ resultType = $ queryReflection ->getResultType ($ queryString , QueryReflector::FETCH_TYPE_ASSOC );
@@ -60,21 +61,22 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
6061 );
6162 }
6263
63- return ParametersAcceptorSelector:: selectSingle ( $ functionReflection -> getVariants ())-> getReturnType () ;
64+ return $ defaultReturn ;
6465 }
6566
6667 public function getTypeFromMethodCall (MethodReflection $ methodReflection , MethodCall $ methodCall , Scope $ scope ): Type
6768 {
6869 $ args = $ methodCall ->getArgs ();
70+ $ defaultReturn = ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ())->getReturnType ();
6971
7072 if (\count ($ args ) < 1 ) {
71- return ParametersAcceptorSelector:: selectSingle ( $ methodReflection -> getVariants ())-> getReturnType () ;
73+ return $ defaultReturn ;
7274 }
7375
7476 $ queryReflection = new QueryReflection ();
7577 $ queryString = $ queryReflection ->resolveQueryString ($ args [0 ]->value , $ scope );
7678 if (null === $ queryString ) {
77- return ParametersAcceptorSelector:: selectSingle ( $ methodReflection -> getVariants ())-> getReturnType () ;
79+ return $ defaultReturn ;
7880 }
7981
8082 $ resultType = $ queryReflection ->getResultType ($ queryString , QueryReflector::FETCH_TYPE_ASSOC );
@@ -85,6 +87,6 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
8587 );
8688 }
8789
88- return ParametersAcceptorSelector:: selectSingle ( $ methodReflection -> getVariants ())-> getReturnType () ;
90+ return $ defaultReturn ;
8991 }
9092}
0 commit comments