55final class CheckReporter
66{
77 public function __construct (
8+ private readonly GitLabCheckReporter $ gitLab ,
89 private readonly SarifCheckReporter $ sarif ,
910 private readonly CheckReportViewBuilder $ viewBuilder ,
1011 ) {
@@ -17,6 +18,7 @@ public function render(CheckResult $result, string $format, bool $verbose, int $
1718 return match ($ format ) {
1819 'json ' => $ this ->json ($ view ),
1920 'github ' => $ this ->github ($ view ),
21+ 'gitlab ' => $ this ->gitLab ->render ($ view ),
2022 'sarif ' => $ this ->sarif ->render ($ view ),
2123 default => $ this ->human ($ view , $ verbose ),
2224 };
@@ -31,6 +33,7 @@ public function codes(array $codes, string $format): string
3133 'diagnosticCodes ' => $ codes ,
3234 ], \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES )."\n" ,
3335 'sarif ' => $ this ->sarif ->codes ($ codes ),
36+ 'gitlab ' => $ this ->gitLab ->codes (),
3437 'github ' => implode ('' , array_map (
3538 fn (string $ code ): string => \sprintf ('::notice title=Symfony diagnostic code::%s%s ' , $ this ->escapeData ($ code ), \PHP_EOL ),
3639 $ codes ,
@@ -45,7 +48,7 @@ public function help(): string
4548Usage: symfony-lsp check [options] [files, directories or patterns]
4649
4750Options:
48- --format=human|json|github|sarif Select the report format
51+ --format=human|json|github|gitlab| sarif Select the report format
4952 --workspace=PATH Set the workspace root
5053 --config=PATH Load a configuration file instead of .symfony-lsp.json
5154 --project-root=PATH Select an explicit Symfony project root; repeatable
0 commit comments