Skip to content

Commit ac0c05e

Browse files
committed
add Autowired attributes
1 parent e6c6b5a commit ac0c05e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Command/ErrorFormatter/GroupedErrorFormatter.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use PHPStan\Analyser\Error;
66
use PHPStan\Command\AnalysisResult;
77
use PHPStan\Command\Output;
8+
use PHPStan\DependencyInjection\AutowiredParameter;
9+
use PHPStan\DependencyInjection\AutowiredService;
810
use PHPStan\File\RelativePathHelper;
911
use Symfony\Component\Console\Formatter\OutputFormatter;
1012
use function count;
@@ -13,12 +15,19 @@
1315
use function str_replace;
1416
use function uasort;
1517

18+
#[AutowiredService(name: 'errorFormatter.grouped')]
1619
final class GroupedErrorFormatter implements ErrorFormatter
1720
{
1821

1922
private const NO_IDENTIFIER = 'without identifier';
2023

21-
public function __construct(private RelativePathHelper $relativePathHelper, private ?string $editorUrl, private ?string $editorUrlTitle)
24+
public function __construct(
25+
#[AutowiredParameter(ref: '@simpleRelativePathHelper')]
26+
private RelativePathHelper $relativePathHelper,
27+
#[AutowiredParameter]
28+
private ?string $editorUrl,
29+
#[AutowiredParameter]
30+
private ?string $editorUrlTitle)
2231
{
2332
}
2433

0 commit comments

Comments
 (0)