Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 20, 2024
1 parent 12c94b5 commit 8f0fc34
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,14 @@ public function processNodes(
// do not return early, as its properties will be checked next
if (! $node instanceof VirtualNode) {
$node->setAttribute(AttributeKey::SCOPE, $mutatingScope);
} elseif ($node instanceof AlwaysRememberedExpr) {
} elseif ($node instanceof AlwaysRememberedExpr || $node instanceof Match_) {
$hasAlwaysRememberedExpr = true;

if ($node instanceof Match_) {
$this->processMatch($node, $mutatingScope);
}

return;
}

if ($node instanceof FileWithoutNamespace) {
Expand Down Expand Up @@ -370,11 +376,6 @@ public function processNodes(
return;
}

if ($node instanceof Match_) {
$this->processMatch($node, $mutatingScope);
return;
}

if ($node instanceof Yield_) {
$this->processYield($node, $mutatingScope);
return;
Expand Down

0 comments on commit 8f0fc34

Please sign in to comment.