Skip to content

Commit

Permalink
Merge pull request #10605 from edsrzf/php-parser-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan authored Jan 30, 2024
2 parents 35e6eff + f1a206f commit 04ba935
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/CodeLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Analyzer/ClassAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ static function (FunctionLikeParameter $param): PhpParser\Node\Arg {
$fake_stmt = new VirtualClassMethod(
new VirtualIdentifier('__construct'),
[
'type' => PhpParser\Node\Stmt\Class_::MODIFIER_PUBLIC,
'flags' => PhpParser\Node\Stmt\Class_::MODIFIER_PUBLIC,
'params' => $fake_constructor_params,
'stmts' => $fake_constructor_stmts,
],
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
}

Expand Down

0 comments on commit 04ba935

Please sign in to comment.