Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Command/ErrorFormatter/CiDetectedErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class CiDetectedErrorFormatter implements ErrorFormatter
public function __construct(
private GithubErrorFormatter $githubErrorFormatter,
private TeamcityErrorFormatter $teamcityErrorFormatter,
private GitlabErrorFormatter $gitlabErrorFormatter,
)
{
}
Expand All @@ -31,6 +32,8 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
return $this->githubErrorFormatter->formatErrors($analysisResult, $output);
} elseif ($ci->getCiName() === CiDetector::CI_TEAMCITY) {
return $this->teamcityErrorFormatter->formatErrors($analysisResult, $output);
} elseif ($ci->getCiName() === CiDetector::CI_GITLAB) {
return $this->gitlabErrorFormatter->formatErrors($analysisResult, $output);
}
} catch (CiNotDetectedException) {
// pass
Expand Down
2 changes: 2 additions & 0 deletions tests/PHPStan/Command/AnalyseApplicationIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPStan\Analyser\ResultCache\ResultCacheClearer;
use PHPStan\Command\ErrorFormatter\CiDetectedErrorFormatter;
use PHPStan\Command\ErrorFormatter\GithubErrorFormatter;
use PHPStan\Command\ErrorFormatter\GitlabErrorFormatter;
use PHPStan\Command\ErrorFormatter\TableErrorFormatter;
use PHPStan\Command\ErrorFormatter\TeamcityErrorFormatter;
use PHPStan\Command\Symfony\SymfonyOutput;
Expand Down Expand Up @@ -74,6 +75,7 @@ private function runPath(string $path, int $expectedStatusCode): string
new CiDetectedErrorFormatter(
new GithubErrorFormatter($relativePathHelper),
new TeamcityErrorFormatter($relativePathHelper),
new GitlabErrorFormatter($relativePathHelper),
),
false,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ private function createErrorFormatter(?string $editorUrl, ?string $editorUrlTitl
new CiDetectedErrorFormatter(
new GithubErrorFormatter($relativePathHelper),
new TeamcityErrorFormatter($relativePathHelper),
new GitlabErrorFormatter($relativePathHelper),
),
false,
$editorUrl,
Expand Down
Loading