Skip to content

Commit

Permalink
Cast line to int in SARIF formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 6, 2024
1 parent 9973195 commit 1edb598
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/PHPStan/SarifErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
'uri' => $this->relativePathHelper->getRelativePath($fileSpecificError->getFile()),
'uriBaseId' => self::URI_BASE_ID,
],
'region' => [
'startLine' => $fileSpecificError->getLine(),
],
],
],
],
Expand All @@ -78,6 +75,10 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
$result['properties']['tip'] = $fileSpecificError->getTip();
}

if ($fileSpecificError->getLine() !== null) {
$result['locations'][0]['physicalLocation']['region']['startLine'] = $fileSpecificError->getLine();
}

$results[] = $result;
}

Expand Down

0 comments on commit 1edb598

Please sign in to comment.