Skip to content

Commit cd1c978

Browse files
committed
register with attributes
1 parent 4a67a93 commit cd1c978

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

conf/services.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,6 @@ services:
107107
configPhpVersion: %phpVersion%
108108
autowired: false
109109

110-
-
111-
class: PHPStan\Analyser\ProcessedFilesCollector
112-
113-
-
114-
class: PHPStan\Analyser\ProcessedFilesDiagnoseExtension
115-
arguments:
116-
simpleRelativePathHelper: @simpleRelativePathHelper
117-
tags:
118-
- phpstan.diagnoseExtension
119-
120110
# not registered using attributes because there is 2+ instances
121111
-
122112
class: PHPStan\Type\Php\ReflectionGetAttributesMethodReturnTypeExtension

src/Analyser/ProcessedFilesCollector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace PHPStan\Analyser;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use function array_count_values;
67
use function array_slice;
78
use function arsort;
89

10+
#[AutowiredService]
911
final class ProcessedFilesCollector
1012
{
1113

src/Analyser/ProcessedFilesDiagnoseExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
namespace PHPStan\Analyser;
44

55
use PHPStan\Command\Output;
6+
use PHPStan\DependencyInjection\AutowiredParameter;
7+
use PHPStan\DependencyInjection\AutowiredService;
68
use PHPStan\Diagnose\DiagnoseExtension;
79
use PHPStan\File\RelativePathHelper;
810
use function count;
911
use function sprintf;
1012

13+
#[AutowiredService]
1114
final class ProcessedFilesDiagnoseExtension implements DiagnoseExtension
1215
{
1316

1417
public function __construct(
1518
private ProcessedFilesCollector $processedFilesCollector,
19+
#[AutowiredParameter(ref: '@simpleRelativePathHelper')]
1620
private RelativePathHelper $simpleRelativePathHelper,
1721
)
1822
{

0 commit comments

Comments
 (0)