Skip to content

Commit

Permalink
Use Node::getStartLine() in FindAnonymousClassVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Apr 6, 2024
1 parent dbf0a11 commit 5d2ff96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PhpParserReflector/FindAnonymousClassVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5d2ff96

Please sign in to comment.