From ba859e2826f2a5067632b16e5392ccb1ab54881d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Fri, 29 Aug 2025 15:40:20 +0700 Subject: [PATCH] [Scope] No need to set startLine/endLine when it already set --- src/Application/ChangedNodeScopeRefresher.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Application/ChangedNodeScopeRefresher.php b/src/Application/ChangedNodeScopeRefresher.php index 2c06ca34b11..b6c653099ed 100644 --- a/src/Application/ChangedNodeScopeRefresher.php +++ b/src/Application/ChangedNodeScopeRefresher.php @@ -149,6 +149,10 @@ private function setLineAttributesOnClass(Class_ $class, Attribute|AttributeGrou $this->simpleCallableNodeTraverser->traverseNodesWithCallable([$class], function (Node $subNode) use ( $node ): Node { + if ($subNode->getStartLine() > 0 && $subNode->getEndLine() > 0) { + return $subNode; + } + $subNode->setAttribute('startLine', $node->getStartLine()); $subNode->setAttribute('endLine', $node->getEndLine());