@@ -3299,6 +3299,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
32993299 $ classType = null ;
33003300 $ methodReflection = null ;
33013301 $ methodName = null ;
3302+ $ dynamicCall = false ;
33023303 if ($ expr ->name instanceof Expr) {
33033304 $ result = $ this ->processExprNode ($ stmt , $ expr ->name , $ scope , $ storage , $ nodeCallback , $ context ->enterDeep ());
33043305 $ hasYield = $ hasYield || $ result ->hasYield ();
@@ -3311,6 +3312,7 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
33113312 } elseif ($ expr ->class instanceof Expr) {
33123313 $ classType = TypeCombinator::removeNull ($ scope ->getType ($ expr ->class ))->getObjectTypeOrClassStringObjectType ();
33133314 $ methodName = $ expr ->name ->name ;
3315+ $ dynamicCall = true ;
33143316 }
33153317
33163318 if ($ classType !== null && $ methodName !== null ) {
@@ -3323,9 +3325,11 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
33233325 $ methodReflection ->getNamedArgumentsVariants (),
33243326 );
33253327
3326- $ methodThrowPoint = $ this ->getStaticMethodThrowPoint ($ methodReflection , $ parametersAcceptor , $ expr , $ scope );
3327- if ($ methodThrowPoint !== null ) {
3328- $ throwPoints [] = $ methodThrowPoint ;
3328+ if (!$ dynamicCall ) {
3329+ $ methodThrowPoint = $ this ->getStaticMethodThrowPoint ($ methodReflection , $ parametersAcceptor , $ expr , $ scope );
3330+ if ($ methodThrowPoint !== null ) {
3331+ $ throwPoints [] = $ methodThrowPoint ;
3332+ }
33293333 }
33303334
33313335 $ declaringClass = $ methodReflection ->getDeclaringClass ();
0 commit comments