Skip to content

Commit f19573c

Browse files
authored
Merge branch refs/heads/1.12.x into 2.0.x
2 parents 70a3e07 + b38c852 commit f19573c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,15 +3153,27 @@ static function (): void {
31533153
$throwPoints = $result->getThrowPoints();
31543154
$impurePoints = $result->getImpurePoints();
31553155
} elseif ($expr instanceof Expr\ClassConstFetch) {
3156-
$hasYield = false;
3157-
$throwPoints = [];
3158-
$impurePoints = [];
31593156
if ($expr->class instanceof Expr) {
31603157
$result = $this->processExprNode($stmt, $expr->class, $scope, $nodeCallback, $context->enterDeep());
31613158
$scope = $result->getScope();
31623159
$hasYield = $result->hasYield();
31633160
$throwPoints = $result->getThrowPoints();
31643161
$impurePoints = $result->getImpurePoints();
3162+
} else {
3163+
$hasYield = false;
3164+
$throwPoints = [];
3165+
$impurePoints = [];
3166+
$nodeCallback($expr->class, $scope);
3167+
}
3168+
3169+
if ($expr->name instanceof Expr) {
3170+
$result = $this->processExprNode($stmt, $expr->name, $scope, $nodeCallback, $context->enterDeep());
3171+
$scope = $result->getScope();
3172+
$hasYield = $hasYield || $result->hasYield();
3173+
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
3174+
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
3175+
} else {
3176+
$nodeCallback($expr->name, $scope);
31653177
}
31663178
} elseif ($expr instanceof Expr\Empty_) {
31673179
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->expr);

0 commit comments

Comments
 (0)