Skip to content

Commit

Permalink
JsonErrorFormatter - include identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Mar 30, 2023
1 parent f60d56e commit 6910be2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Command/ErrorFormatter/JsonErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
$message['tip'] = $tipFormatter->format($fileSpecificError->getTip());
}

if ($fileSpecificError->getIdentifier() !== null) {
$message['identifier'] = $fileSpecificError->getIdentifier();
}

$errorsArray['files'][$file]['messages'][] = $message;
}

Expand Down
1 change: 1 addition & 0 deletions src/Testing/LevelsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public function testLevels(
}

unset($message['tip']);
unset($message['identifier']);

$messages[] = $message;
}
Expand Down

0 comments on commit 6910be2

Please sign in to comment.