Skip to content

Commit 399c426

Browse files
committed
Revert "Update NodeScopeResolver.php"
This reverts commit 48601a3.
1 parent 48601a3 commit 399c426

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,22 @@ function (MutatingScope $scope) use ($stmt, $expr, $nodeCallback, $context, $sto
33753375
}
33763376
}
33773377

3378+
if ($expr->class instanceof Expr) {
3379+
$objectClasses = $scope->getType($expr->class)->getObjectClassNames();
3380+
if (count($objectClasses) !== 1) {
3381+
$objectClasses = $scope->getType(new New_($expr->class))->getObjectClassNames();
3382+
}
3383+
if (count($objectClasses) === 1) {
3384+
$objectExprResult = $this->processExprNode($stmt, new StaticCall(new Name($objectClasses[0]), $expr->name, []), $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
3385+
$additionalThrowPoints = $objectExprResult->getThrowPoints();
3386+
} else {
3387+
$additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr)];
3388+
}
3389+
foreach ($additionalThrowPoints as $throwPoint) {
3390+
$throwPoints[] = $throwPoint;
3391+
}
3392+
}
3393+
33783394
if ($methodReflection !== null) {
33793395
$impurePoint = SimpleImpurePoint::createFromVariant($methodReflection, $parametersAcceptor, $scope, $expr->getArgs());
33803396
if ($impurePoint !== null) {

0 commit comments

Comments
 (0)