Skip to content

Commit 9117c2b

Browse files
authored
Merge branch refs/heads/1.10.x into 1.11.x
2 parents ed2f29e + bf0b138 commit 9117c2b

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/Analyser/NodeScopeResolver.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,9 @@ private function processStmtNode(
737737
$this->processAttributeGroups($stmt, $stmt->attrGroups, $scope, $nodeCallback);
738738

739739
foreach ($stmt->props as $prop) {
740-
$this->processStmtNode($prop, $scope, $nodeCallback, $context);
740+
if ($prop->default !== null) {
741+
$this->processExprNode($stmt, $prop->default, $scope, $nodeCallback, ExpressionContext::createDeep());
742+
}
741743
[,,,,,,,,,,$isReadOnly, $docComment, ,,,$varTags, $isAllowedPrivateMutation] = $this->getPhpDocs($scope, $stmt);
742744
if (!$scope->isInClass()) {
743745
throw new ShouldNotHappenException();
@@ -773,12 +775,6 @@ private function processStmtNode(
773775
if ($stmt->type !== null) {
774776
$nodeCallback($stmt->type, $scope);
775777
}
776-
} elseif ($stmt instanceof Node\Stmt\PropertyProperty) {
777-
$hasYield = false;
778-
$throwPoints = [];
779-
if ($stmt->default !== null) {
780-
$this->processExprNode($stmt, $stmt->default, $scope, $nodeCallback, ExpressionContext::createDeep());
781-
}
782778
} elseif ($stmt instanceof Throw_) {
783779
$result = $this->processExprNode($stmt, $stmt->expr, $scope, $nodeCallback, ExpressionContext::createDeep());
784780
$throwPoints = $result->getThrowPoints();
@@ -1520,7 +1516,7 @@ private function processStmtNode(
15201516
$hasYield = false;
15211517
$throwPoints = [];
15221518
foreach ($stmt->uses as $use) {
1523-
$this->processStmtNode($use, $scope, $nodeCallback, $context);
1519+
$nodeCallback($use, $scope);
15241520
}
15251521
} elseif ($stmt instanceof Node\Stmt\Global_) {
15261522
$hasYield = false;
@@ -1604,14 +1600,11 @@ private function processStmtNode(
16041600
} elseif ($stmt instanceof Node\Stmt\Nop) {
16051601
$hasYield = false;
16061602
$throwPoints = $overridingThrowPoints ?? [];
1607-
} elseif ($stmt instanceof Node\Stmt\UseUse) {
1608-
$hasYield = false;
1609-
$throwPoints = [];
16101603
} elseif ($stmt instanceof Node\Stmt\GroupUse) {
16111604
$hasYield = false;
16121605
$throwPoints = [];
16131606
foreach ($stmt->uses as $use) {
1614-
$this->processStmtNode($use, $scope, $nodeCallback, $context);
1607+
$nodeCallback($use, $scope);
16151608
}
16161609
} else {
16171610
$hasYield = false;

0 commit comments

Comments
 (0)