Skip to content

Commit 0af24e2

Browse files
committed
Update NodeScopeResolver.php
1 parent f353a50 commit 0af24e2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4767,14 +4767,6 @@ private function getFunctionThrowPoint(
47674767

47684768
private function getMethodThrowPoint(MethodReflection $methodReflection, ParametersAcceptor $parametersAcceptor, MethodCall $methodCall, MutatingScope $scope): ?InternalThrowPoint
47694769
{
4770-
if (
4771-
$this->implicitThrows
4772-
&& in_array($methodReflection->getName(), ['invoke', 'invokeArgs'], true)
4773-
&& in_array($methodReflection->getDeclaringClass()->getName(), [ReflectionMethod::class, ReflectionFunction::class], true)
4774-
) {
4775-
return InternalThrowPoint::createImplicit($scope, $methodCall);
4776-
}
4777-
47784770
$normalizedMethodCall = ArgumentsNormalizer::reorderMethodArguments($parametersAcceptor, $methodCall);
47794771
if ($normalizedMethodCall !== null) {
47804772
foreach ($this->dynamicThrowTypeExtensionProvider->getDynamicMethodThrowTypeExtensions() as $extension) {
@@ -4791,6 +4783,13 @@ private function getMethodThrowPoint(MethodReflection $methodReflection, Paramet
47914783
}
47924784
}
47934785

4786+
if (
4787+
in_array($methodReflection->getName(), ['invoke', 'invokeArgs'], true)
4788+
&& in_array($methodReflection->getDeclaringClass()->getName(), [ReflectionMethod::class, ReflectionFunction::class], true)
4789+
) {
4790+
return InternalThrowPoint::createImplicit($scope, $methodCall);
4791+
}
4792+
47944793
$throwType = $methodReflection->getThrowType();
47954794
if ($throwType === null) {
47964795
$returnType = $parametersAcceptor->getReturnType();

0 commit comments

Comments
 (0)