Skip to content

Commit 85ab575

Browse files
committed
Revert "Update NodeScopeResolver.php"
This reverts commit 48601a3.
1 parent 5013543 commit 85ab575

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎src/Analyser/NodeScopeResolver.php‎

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

3423+
if ($expr->class instanceof Expr) {
3424+
$objectClasses = $scope->getType($expr->class)->getObjectClassNames();
3425+
if (count($objectClasses) !== 1) {
3426+
$objectClasses = $scope->getType(new New_($expr->class))->getObjectClassNames();
3427+
}
3428+
if (count($objectClasses) === 1) {
3429+
$objectExprResult = $this->processExprNode($stmt, new StaticCall(new Name($objectClasses[0]), $expr->name, []), $scope, $storage, new NoopNodeCallback(), $context->enterDeep());
3430+
$additionalThrowPoints = $objectExprResult->getThrowPoints();
3431+
} else {
3432+
$additionalThrowPoints = [InternalThrowPoint::createImplicit($scope, $expr)];
3433+
}
3434+
foreach ($additionalThrowPoints as $throwPoint) {
3435+
$throwPoints[] = $throwPoint;
3436+
}
3437+
}
3438+
34233439
if ($methodReflection !== null) {
34243440
$impurePoint = SimpleImpurePoint::createFromVariant($methodReflection, $parametersAcceptor, $scope, $expr->getArgs());
34253441
if ($impurePoint !== null) {

0 commit comments

Comments
 (0)