From 5d2ff96fba2c216b6c916aa8875100b04f39c332 Mon Sep 17 00:00:00 2001 From: Valentin Udaltsov Date: Sun, 7 Apr 2024 02:40:01 +0300 Subject: [PATCH] Use Node::getStartLine() in FindAnonymousClassVisitor --- PhpParserReflector/FindAnonymousClassVisitor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PhpParserReflector/FindAnonymousClassVisitor.php b/PhpParserReflector/FindAnonymousClassVisitor.php index e987295..da426c7 100644 --- a/PhpParserReflector/FindAnonymousClassVisitor.php +++ b/PhpParserReflector/FindAnonymousClassVisitor.php @@ -27,11 +27,11 @@ public function __construct( public function enterNode(Node $node): ?int { - if ($node->getLine() < $this->name->line) { + if ($node->getStartLine() < $this->name->line) { return null; } - if ($node->getLine() > $this->name->line) { + if ($node->getStartLine() > $this->name->line) { return NodeTraverser::STOP_TRAVERSAL; }