Skip to content

Commit b38c852

Browse files
committed
Process ClassConstFetch::$name
1 parent 712c33e commit b38c852

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Analyser/NodeScopeResolver.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -3159,9 +3159,6 @@ static function (): void {
31593159
$throwPoints = $result->getThrowPoints();
31603160
$impurePoints = $result->getImpurePoints();
31613161
} elseif ($expr instanceof Expr\ClassConstFetch) {
3162-
$hasYield = false;
3163-
$throwPoints = [];
3164-
$impurePoints = [];
31653162
if ($expr->class instanceof Expr) {
31663163
$result = $this->processExprNode($stmt, $expr->class, $scope, $nodeCallback, $context->enterDeep());
31673164
$scope = $result->getScope();
@@ -3174,6 +3171,16 @@ static function (): void {
31743171
$impurePoints = [];
31753172
$nodeCallback($expr->class, $scope);
31763173
}
3174+
3175+
if ($expr->name instanceof Expr) {
3176+
$result = $this->processExprNode($stmt, $expr->name, $scope, $nodeCallback, $context->enterDeep());
3177+
$scope = $result->getScope();
3178+
$hasYield = $hasYield || $result->hasYield();
3179+
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
3180+
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
3181+
} else {
3182+
$nodeCallback($expr->name, $scope);
3183+
}
31773184
} elseif ($expr instanceof Expr\Empty_) {
31783185
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->expr);
31793186
$scope = $this->lookForSetAllowedUndefinedExpressions($nonNullabilityResult->getScope(), $expr->expr);

0 commit comments

Comments
 (0)