Skip to content

Commit

Permalink
Merge branch refs/heads/1.12.x into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot authored Oct 3, 2024
2 parents 70a3e07 + b38c852 commit f19573c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3153,15 +3153,27 @@ static function (): void {
$throwPoints = $result->getThrowPoints();
$impurePoints = $result->getImpurePoints();
} elseif ($expr instanceof Expr\ClassConstFetch) {
$hasYield = false;
$throwPoints = [];
$impurePoints = [];
if ($expr->class instanceof Expr) {
$result = $this->processExprNode($stmt, $expr->class, $scope, $nodeCallback, $context->enterDeep());
$scope = $result->getScope();
$hasYield = $result->hasYield();
$throwPoints = $result->getThrowPoints();
$impurePoints = $result->getImpurePoints();
} else {
$hasYield = false;
$throwPoints = [];
$impurePoints = [];
$nodeCallback($expr->class, $scope);
}

if ($expr->name instanceof Expr) {
$result = $this->processExprNode($stmt, $expr->name, $scope, $nodeCallback, $context->enterDeep());
$scope = $result->getScope();
$hasYield = $hasYield || $result->hasYield();
$throwPoints = array_merge($throwPoints, $result->getThrowPoints());
$impurePoints = array_merge($impurePoints, $result->getImpurePoints());
} else {
$nodeCallback($expr->name, $scope);
}
} elseif ($expr instanceof Expr\Empty_) {
$nonNullabilityResult = $this->ensureNonNullability($scope, $expr->expr);
Expand Down

0 comments on commit f19573c

Please sign in to comment.