@@ -269,33 +269,30 @@ public function processExpr(NodeScopeResolver $nodeScopeResolver, Stmt $stmt, Ex
269269 );
270270 }
271271
272- private function getStaticMethodThrowPoint (MethodReflection $ methodReflection , ParametersAcceptor $ parametersAcceptor , StaticCall $ methodCall , MutatingScope $ scope ): ?InternalThrowPoint
272+ private function getStaticMethodThrowPoint (MethodReflection $ methodReflection , ParametersAcceptor $ parametersAcceptor , StaticCall $ normalizedMethodCall , MutatingScope $ scope ): ?InternalThrowPoint
273273 {
274- $ normalizedMethodCall = ArgumentsNormalizer::reorderStaticCallArguments ($ parametersAcceptor , $ methodCall );
275- if ($ normalizedMethodCall !== null ) {
276- foreach ($ this ->dynamicThrowTypeExtensionProvider ->getDynamicStaticMethodThrowTypeExtensions () as $ extension ) {
277- if (!$ extension ->isStaticMethodSupported ($ methodReflection )) {
278- continue ;
279- }
280-
281- $ throwType = $ extension ->getThrowTypeFromStaticMethodCall ($ methodReflection , $ normalizedMethodCall , $ scope );
282- if ($ throwType === null ) {
283- return null ;
284- }
274+ foreach ($ this ->dynamicThrowTypeExtensionProvider ->getDynamicStaticMethodThrowTypeExtensions () as $ extension ) {
275+ if (!$ extension ->isStaticMethodSupported ($ methodReflection )) {
276+ continue ;
277+ }
285278
286- return InternalThrowPoint::createExplicit ($ scope , $ throwType , $ methodCall , false );
279+ $ throwType = $ extension ->getThrowTypeFromStaticMethodCall ($ methodReflection , $ normalizedMethodCall , $ scope );
280+ if ($ throwType === null ) {
281+ return null ;
287282 }
283+
284+ return InternalThrowPoint::createExplicit ($ scope , $ throwType , $ normalizedMethodCall , false );
288285 }
289286
290287 if ($ methodReflection ->getThrowType () !== null ) {
291288 $ throwType = $ methodReflection ->getThrowType ();
292289 if (!$ throwType ->isVoid ()->yes ()) {
293- return InternalThrowPoint::createExplicit ($ scope , $ throwType , $ methodCall , true );
290+ return InternalThrowPoint::createExplicit ($ scope , $ throwType , $ normalizedMethodCall , true );
294291 }
295292 } elseif ($ this ->implicitThrows ) {
296- $ methodReturnedType = $ scope ->getType ($ methodCall );
293+ $ methodReturnedType = $ scope ->getType ($ normalizedMethodCall );
297294 if (!(new ObjectType (Throwable::class))->isSuperTypeOf ($ methodReturnedType )->yes ()) {
298- return InternalThrowPoint::createImplicit ($ scope , $ methodCall );
295+ return InternalThrowPoint::createImplicit ($ scope , $ normalizedMethodCall );
299296 }
300297 }
301298
0 commit comments