Skip to content

Commit 38bfb84

Browse files
ruudkondrejmirtes
authored andcommitted
GithubErrorFormatter > Allow any ErrorFormatter
This makes it possible to use the `GithubErrorFormatter` with any `ErrorFormatter`.
1 parent 087afca commit 38bfb84

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

conf/config.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,7 @@ services:
17891789
class: PHPStan\Command\ErrorFormatter\GithubErrorFormatter
17901790
arguments:
17911791
relativePathHelper: @simpleRelativePathHelper
1792+
errorFormatter: @errorFormatter.table
17921793

17931794
errorFormatter.teamcity:
17941795
class: PHPStan\Command\ErrorFormatter\TeamcityErrorFormatter

src/Command/ErrorFormatter/GithubErrorFormatter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ class GithubErrorFormatter implements ErrorFormatter
1919

2020
private RelativePathHelper $relativePathHelper;
2121

22-
private TableErrorFormatter $tableErrorformatter;
22+
private ErrorFormatter $errorFormatter;
2323

2424
public function __construct(
2525
RelativePathHelper $relativePathHelper,
26-
TableErrorFormatter $tableErrorformatter
26+
ErrorFormatter $errorFormatter
2727
)
2828
{
2929
$this->relativePathHelper = $relativePathHelper;
30-
$this->tableErrorformatter = $tableErrorformatter;
30+
$this->errorFormatter = $errorFormatter;
3131
}
3232

3333
public function formatErrors(AnalysisResult $analysisResult, Output $output): int
3434
{
35-
$this->tableErrorformatter->formatErrors($analysisResult, $output);
35+
$this->errorFormatter->formatErrors($analysisResult, $output);
3636

3737
foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
3838
$metas = [

0 commit comments

Comments
 (0)