From 8f0fc34595b230cf0b5d8ad87d4153937c444912 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 20 Dec 2024 18:58:46 +0700 Subject: [PATCH] fix --- .../PHPStan/Scope/PHPStanNodeScopeResolver.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php index bf9d69b4a8..c2e81a06bb 100644 --- a/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php +++ b/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php @@ -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) { @@ -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;