File tree Expand file tree Collapse file tree 6 files changed +29
-36
lines changed
BetterReflection/SourceLocator Expand file tree Collapse file tree 6 files changed +29
-36
lines changed Original file line number Diff line number Diff line change @@ -366,47 +366,11 @@ services:
366366 fileExtensions : %fileExtensions%
367367 autowired : false
368368
369- -
370- class : PHPStan\File\FileMonitor
371- arguments :
372- analyseFileFinder : @fileFinderAnalyse
373- scanFileFinder : @fileFinderScan
374- analysedPaths : %analysedPaths%
375- analysedPathsFromConfig : %analysedPathsFromConfig%
376- scanFiles : %scanFiles%
377- scanDirectories : %scanDirectories%
378-
379- -
380- class : PHPStan\Parallel\ParallelAnalyser
381- arguments :
382- internalErrorsCountLimit : %internalErrorsCountLimit%
383- processTimeout : %parallel.processTimeout%
384- decoderBufferSize : %parallel.buffer%
385-
386- -
387- class : PHPStan\Parallel\Scheduler
388- arguments :
389- jobSize : %parallel.jobSize%
390- maximumNumberOfProcesses : %parallel.maximumNumberOfProcesses%
391- minimumNumberOfJobsPerProcess : %parallel.minimumNumberOfJobsPerProcess%
392- tags :
393- - phpstan.diagnoseExtension
394-
395369 -
396370 implement : PHPStan\Reflection\FunctionReflectionFactory
397371 arguments :
398372 parser : @defaultAnalysisParser
399373
400- -
401- class : PHPStan\Reflection\InitializerExprTypeResolver
402- arguments :
403- usePathConstantsAsConstantString : %usePathConstantsAsConstantString%
404-
405- -
406- class : PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher
407- arguments :
408- parser : @defaultAnalysisParser
409-
410374 -
411375 class : PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorFactory
412376 arguments :
Original file line number Diff line number Diff line change 22
33namespace PHPStan \File ;
44
5+ use PHPStan \DependencyInjection \AutowiredParameter ;
6+ use PHPStan \DependencyInjection \AutowiredService ;
57use PHPStan \ShouldNotHappenException ;
68use function array_diff ;
79use function array_key_exists ;
1214use function is_file ;
1315use function sha1_file ;
1416
17+ #[AutowiredService]
1518final class FileMonitor
1619{
1720
@@ -28,11 +31,17 @@ final class FileMonitor
2831 * @param string[] $scanDirectories
2932 */
3033 public function __construct (
34+ #[AutowiredParameter(ref: '@fileFinderAnalyse ' )]
3135 private FileFinder $ analyseFileFinder ,
36+ #[AutowiredParameter(ref: '@fileFinderScan ' )]
3237 private FileFinder $ scanFileFinder ,
38+ #[AutowiredParameter]
3339 private array $ analysedPaths ,
40+ #[AutowiredParameter]
3441 private array $ analysedPathsFromConfig ,
42+ #[AutowiredParameter]
3543 private array $ scanFiles ,
44+ #[AutowiredParameter]
3645 private array $ scanDirectories ,
3746 )
3847 {
Original file line number Diff line number Diff line change 1010use PHPStan \Analyser \Error ;
1111use PHPStan \Analyser \InternalError ;
1212use PHPStan \Dependency \RootExportedNode ;
13+ use PHPStan \DependencyInjection \AutowiredParameter ;
14+ use PHPStan \DependencyInjection \AutowiredService ;
1315use PHPStan \Process \ProcessHelper ;
1416use React \EventLoop \LoopInterface ;
1517use React \Promise \Deferred ;
3335use function str_contains ;
3436use const PHP_URL_PORT ;
3537
38+ #[AutowiredService]
3639final class ParallelAnalyser
3740{
3841
@@ -43,8 +46,11 @@ final class ParallelAnalyser
4346 private ProcessPool $ processPool ;
4447
4548 public function __construct (
49+ #[AutowiredParameter]
4650 private int $ internalErrorsCountLimit ,
51+ #[AutowiredParameter(ref: '%parallel.processTimeout% ' )]
4752 float $ processTimeout ,
53+ #[AutowiredParameter(ref: '%parallel.buffer% ' )]
4854 private int $ decoderBufferSize ,
4955 )
5056 {
Original file line number Diff line number Diff line change 33namespace PHPStan \Parallel ;
44
55use PHPStan \Command \Output ;
6+ use PHPStan \DependencyInjection \AutowiredParameter ;
7+ use PHPStan \DependencyInjection \AutowiredService ;
68use PHPStan \Diagnose \DiagnoseExtension ;
79use function array_chunk ;
810use function count ;
1113use function min ;
1214use function sprintf ;
1315
16+ #[AutowiredService]
1417final class Scheduler implements DiagnoseExtension
1518{
1619
@@ -23,8 +26,11 @@ final class Scheduler implements DiagnoseExtension
2326 * @param positive-int $minimumNumberOfJobsPerProcess
2427 */
2528 public function __construct (
29+ #[AutowiredParameter(ref: '%parallel.jobSize% ' )]
2630 private int $ jobSize ,
31+ #[AutowiredParameter(ref: '%parallel.maximumNumberOfProcesses% ' )]
2732 private int $ maximumNumberOfProcesses ,
33+ #[AutowiredParameter(ref: '%parallel.minimumNumberOfJobsPerProcess% ' )]
2834 private int $ minimumNumberOfJobsPerProcess ,
2935 )
3036 {
Original file line number Diff line number Diff line change 33namespace PHPStan \Reflection \BetterReflection \SourceLocator ;
44
55use PhpParser \NodeTraverser ;
6+ use PHPStan \DependencyInjection \AutowiredParameter ;
7+ use PHPStan \DependencyInjection \AutowiredService ;
68use PHPStan \File \FileReader ;
79use PHPStan \Parser \Parser ;
810use PHPStan \Parser \ParserErrorsException ;
911
12+ #[AutowiredService]
1013final class FileNodesFetcher
1114{
1215
1316 public function __construct (
1417 private CachingVisitor $ cachingVisitor ,
18+ #[AutowiredParameter(ref: '@defaultAnalysisParser ' )]
1519 private Parser $ parser ,
1620 )
1721 {
Original file line number Diff line number Diff line change 2020use PhpParser \Node \Scalar \String_ ;
2121use PHPStan \Analyser \ConstantResolver ;
2222use PHPStan \Analyser \OutOfClassScope ;
23+ use PHPStan \DependencyInjection \AutowiredParameter ;
24+ use PHPStan \DependencyInjection \AutowiredService ;
2325use PHPStan \DependencyInjection \Type \OperatorTypeSpecifyingExtensionRegistryProvider ;
2426use PHPStan \Node \Expr \TypeExpr ;
2527use PHPStan \Php \PhpVersion ;
9193use function strtolower ;
9294use const INF ;
9395
96+ #[AutowiredService]
9497final class InitializerExprTypeResolver
9598{
9699
@@ -105,6 +108,7 @@ public function __construct(
105108 private PhpVersion $ phpVersion ,
106109 private OperatorTypeSpecifyingExtensionRegistryProvider $ operatorTypeSpecifyingExtensionRegistryProvider ,
107110 private OversizedArrayBuilder $ oversizedArrayBuilder ,
111+ #[AutowiredParameter]
108112 private bool $ usePathConstantsAsConstantString ,
109113 )
110114 {
You can’t perform that action at this time.
0 commit comments