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; }