From f1a206fbf523ad1cd50c1cc73961a26175596a9d Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Wed, 10 Jan 2024 08:41:01 +1300 Subject: [PATCH] Remove usages of deprecated getLine --- src/Psalm/CodeLocation.php | 2 +- src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/CodeLocation.php b/src/Psalm/CodeLocation.php index 344a5981972..1d80ef71912 100644 --- a/src/Psalm/CodeLocation.php +++ b/src/Psalm/CodeLocation.php @@ -157,7 +157,7 @@ public function __construct( $this->preview_start = $this->docblock_start ?: $this->file_start; /** @psalm-suppress ImpureMethodCall Actually mutation-free just not marked */ - $this->raw_line_number = $stmt->getLine(); + $this->raw_line_number = $stmt->getStartLine(); $this->docblock_line_number = $comment_line; } diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index c8a05ea6d65..188e073153e 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -546,7 +546,7 @@ public function leaveNode(PhpParser\Node $node) } throw new UnexpectedValueException( - 'There should be function storages for line ' . $this->file_path . ':' . $node->getLine(), + 'There should be function storages for line ' . $this->file_path . ':' . $node->getStartLine(), ); }