Skip to content

Commit 1edb598

Browse files
committed
Cast line to int in SARIF formatter
1 parent 9973195 commit 1edb598

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/PHPStan/SarifErrorFormatter.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
6363
'uri' => $this->relativePathHelper->getRelativePath($fileSpecificError->getFile()),
6464
'uriBaseId' => self::URI_BASE_ID,
6565
],
66-
'region' => [
67-
'startLine' => $fileSpecificError->getLine(),
68-
],
6966
],
7067
],
7168
],
@@ -78,6 +75,10 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
7875
$result['properties']['tip'] = $fileSpecificError->getTip();
7976
}
8077

78+
if ($fileSpecificError->getLine() !== null) {
79+
$result['locations'][0]['physicalLocation']['region']['startLine'] = $fileSpecificError->getLine();
80+
}
81+
8182
$results[] = $result;
8283
}
8384

0 commit comments

Comments
 (0)