@@ -144,6 +144,18 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
144144 } else {
145145 $ throwPoints [] = InternalThrowPoint::createImplicit ($ scope , $ expr );
146146 }
147+ } elseif ($ expr ->class instanceof Expr) {
148+ $ classType = $ scope ->getType ($ expr ->class )->getObjectTypeOrClassStringObjectType ();
149+ $ methodName = $ expr ->name ->name ;
150+ $ methodReflection = $ scope ->getMethodReflection ($ classType , $ methodName );
151+ if ($ methodReflection !== null ) {
152+ $ parametersAcceptor = ParametersAcceptorSelector::selectFromArgs (
153+ $ scope ,
154+ $ expr ->getArgs (),
155+ $ methodReflection ->getVariants (),
156+ $ methodReflection ->getNamedArgumentsVariants (),
157+ );
158+ }
147159 }
148160 } else {
149161 $ nameResult = $ nodeScopeResolver ->processExprNode ($ stmt , $ expr ->name , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
@@ -202,7 +214,8 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
202214 }
203215
204216 if (
205- $ methodReflection !== null
217+ $ expr ->class instanceof Name
218+ && $ methodReflection !== null
206219 && (
207220 (
208221 !$ methodReflection ->isStatic ()
@@ -215,7 +228,8 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
215228 ) {
216229 $ scope = $ scope ->invalidateExpression (new Variable ('this ' ), true , $ methodReflection ->getDeclaringClass ());
217230 } elseif (
218- $ methodReflection !== null
231+ $ expr ->class instanceof Name
232+ && $ methodReflection !== null
219233 && $ this ->rememberPossiblyImpureFunctionValues
220234 && $ scope ->isInClass ()
221235 && $ scope ->getClassReflection ()->is ($ methodReflection ->getDeclaringClass ()->getName ())
@@ -230,7 +244,8 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
230244 }
231245
232246 if (
233- $ methodReflection !== null
247+ $ expr ->class instanceof Name
248+ && $ methodReflection !== null
234249 && !$ methodReflection ->isStatic ()
235250 && $ methodReflection ->getName () === '__construct '
236251 && $ scopeFunction instanceof MethodReflection
0 commit comments