Skip to content

Commit 6194cf2

Browse files
authored
More service converted to #[AutowiredService] attribute usage
1 parent da40fdb commit 6194cf2

File tree

47 files changed

+93
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+93
-143
lines changed

conf/config.neon

Lines changed: 0 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ services:
230230
-
231231
class: PhpParser\BuilderFactory
232232

233-
-
234-
class: PHPStan\Parser\LexerFactory
235-
236233
-
237234
class: PhpParser\NodeVisitor\NameResolver
238235
arguments:
@@ -384,25 +381,10 @@ services:
384381
-
385382
class: PHPStan\PhpDocParser\Printer\Printer
386383

387-
-
388-
class: PHPStan\PhpDoc\PhpDocStringResolver
389-
390-
-
391-
class: PHPStan\PhpDoc\ConstExprNodeResolver
392-
393-
-
394-
class: PHPStan\PhpDoc\TypeNodeResolver
395-
396384
-
397385
class: PHPStan\PhpDoc\TypeNodeResolverExtensionRegistryProvider
398386
factory: PHPStan\PhpDoc\LazyTypeNodeResolverExtensionRegistryProvider
399387

400-
-
401-
class: PHPStan\PhpDoc\TypeStringResolver
402-
403-
-
404-
class: PHPStan\PhpDoc\StubValidator
405-
406388
-
407389
class: PHPStan\PhpDoc\DefaultStubFilesProvider
408390
arguments:
@@ -411,21 +393,6 @@ services:
411393
autowired:
412394
- PHPStan\PhpDoc\StubFilesProvider
413395

414-
-
415-
class: PHPStan\PhpDoc\JsonValidateStubFilesExtension
416-
tags:
417-
- phpstan.stubFilesExtension
418-
419-
-
420-
class: PHPStan\PhpDoc\ReflectionClassStubFilesExtension
421-
tags:
422-
- phpstan.stubFilesExtension
423-
424-
-
425-
class: PHPStan\PhpDoc\ReflectionEnumStubFilesExtension
426-
tags:
427-
- phpstan.stubFilesExtension
428-
429396
-
430397
class: PHPStan\Analyser\Analyser
431398
arguments:
@@ -441,32 +408,17 @@ services:
441408
arguments:
442409
parser: @defaultAnalysisParser
443410

444-
-
445-
class: PHPStan\Analyser\IgnoreErrorExtensionProvider
446-
447-
-
448-
class: PHPStan\Analyser\LocalIgnoresProcessor
449-
450-
-
451-
class: PHPStan\Analyser\RuleErrorTransformer
452-
453411
-
454412
class: PHPStan\Analyser\Ignore\IgnoredErrorHelper
455413
arguments:
456414
ignoreErrors: %ignoreErrors%
457415
reportUnmatchedIgnoredErrors: %reportUnmatchedIgnoredErrors%
458416

459-
-
460-
class: PHPStan\Analyser\Ignore\IgnoreLexer
461-
462417
-
463418
class: PHPStan\Analyser\LazyInternalScopeFactory
464419
autowired:
465420
- PHPStan\Analyser\InternalScopeFactory
466421

467-
-
468-
class: PHPStan\Analyser\ScopeFactory
469-
470422
-
471423
class: PHPStan\Analyser\NodeScopeResolver
472424
arguments:
@@ -486,9 +438,6 @@ services:
486438
class: PHPStan\Analyser\ConstantResolver
487439
factory: @PHPStan\Analyser\ConstantResolverFactory::create()
488440

489-
-
490-
class: PHPStan\Analyser\ConstantResolverFactory
491-
492441
-
493442
implement: PHPStan\Analyser\ResultCache\ResultCacheManagerFactory
494443
arguments:
@@ -511,9 +460,6 @@ services:
511460
arguments:
512461
cacheFilePath: %resultCachePath%
513462

514-
-
515-
class: PHPStan\Analyser\RicherScopeGetTypeHelper
516-
517463
-
518464
class: PHPStan\Cache\Cache
519465
arguments:
@@ -523,15 +469,6 @@ services:
523469
class: PHPStan\Collectors\Registry
524470
factory: @PHPStan\Collectors\RegistryFactory::create
525471

526-
-
527-
class: PHPStan\Collectors\RegistryFactory
528-
529-
-
530-
class: PHPStan\Command\AnalyseApplication
531-
532-
-
533-
class: PHPStan\Command\AnalyserRunner
534-
535472
-
536473
class: PHPStan\Command\FixerApplication
537474
arguments:
@@ -551,12 +488,6 @@ services:
551488
arguments:
552489
parser: @defaultAnalysisParser
553490

554-
-
555-
class: PHPStan\Dependency\ExportedNodeResolver
556-
557-
-
558-
class: PHPStan\Dependency\ExportedNodeVisitor
559-
560491
-
561492
class: PHPStan\DependencyInjection\Container
562493
factory: PHPStan\DependencyInjection\MemoizingContainer
@@ -684,12 +615,6 @@ services:
684615
tags:
685616
- phpstan.diagnoseExtension
686617

687-
-
688-
class: PHPStan\Process\CpuCoreCounter
689-
690-
-
691-
class: PHPStan\Reflection\AttributeReflectionFactory
692-
693618
-
694619
implement: PHPStan\Reflection\FunctionReflectionFactory
695620
arguments:
@@ -706,34 +631,22 @@ services:
706631
-
707632
class: PHPStan\Reflection\Annotations\AnnotationsPropertiesClassReflectionExtension
708633

709-
-
710-
class: PHPStan\Reflection\BetterReflection\SourceLocator\CachingVisitor
711-
712634
-
713635
class: PHPStan\Reflection\BetterReflection\SourceLocator\FileNodesFetcher
714636
arguments:
715637
parser: @defaultAnalysisParser
716638

717-
-
718-
class: PHPStan\Reflection\BetterReflection\SourceLocator\ComposerJsonAndInstalledJsonSourceLocatorMaker
719-
720639
-
721640
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorFactory
722641
arguments:
723642
fileFinder: @fileFinderScan
724643

725-
-
726-
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedDirectorySourceLocatorRepository
727-
728644
-
729645
implement: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedPsrAutoloaderLocatorFactory
730646

731647
-
732648
implement: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocatorFactory
733649

734-
-
735-
class: PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocatorRepository
736-
737650
-
738651
class: PHPStan\Reflection\BetterReflection\Type\AdapterReflectionEnumCaseDynamicReturnTypeExtension
739652
arguments:
@@ -946,37 +859,17 @@ services:
946859
checkClassCaseSensitivity: %checkClassCaseSensitivity%
947860
checkThisOnly: %checkThisOnly%
948861

949-
-
950-
class: PHPStan\Rules\FunctionReturnTypeCheck
951-
-
952-
class: PHPStan\Rules\ParameterCastableToStringCheck
953-
954-
-
955-
class: PHPStan\Rules\Generics\CrossCheckInterfacesHelper
956-
957862
-
958863
class: PHPStan\Rules\Generics\GenericAncestorsCheck
959864
arguments:
960865
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%
961866
checkMissingTypehints: %checkMissingTypehints%
962867

963-
-
964-
class: PHPStan\Rules\Generics\GenericObjectTypeCheck
965-
966-
-
967-
class: PHPStan\Rules\Generics\MethodTagTemplateTypeCheck
968-
969868
-
970869
class: PHPStan\Rules\Generics\TemplateTypeCheck
971870
arguments:
972871
checkClassCaseSensitivity: %checkClassCaseSensitivity%
973872

974-
-
975-
class: PHPStan\Rules\Generics\VarianceCheck
976-
977-
-
978-
class: PHPStan\Rules\InternalTag\RestrictedInternalUsageHelper
979-
980873
-
981874
class: PHPStan\Rules\IssetCheck
982875
arguments:
@@ -1003,54 +896,24 @@ services:
1003896
reportMaybes: %reportMaybesInMethodSignatures%
1004897
reportStatic: %reportStaticMethodSignatures%
1005898

1006-
-
1007-
class: PHPStan\Rules\Methods\MethodParameterComparisonHelper
1008-
1009-
-
1010-
class: PHPStan\Rules\Methods\MethodVisibilityComparisonHelper
1011-
1012899
-
1013900
class: PHPStan\Rules\MissingTypehintCheck
1014901
arguments:
1015902
checkMissingCallableSignature: %checkMissingCallableSignature%
1016903
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%
1017904

1018-
-
1019-
class: PHPStan\Rules\NullsafeCheck
1020-
1021-
-
1022-
class: PHPStan\Rules\Constants\LazyAlwaysUsedClassConstantsExtensionProvider
1023-
1024-
-
1025-
class: PHPStan\Rules\Methods\LazyAlwaysUsedMethodExtensionProvider
1026-
1027-
-
1028-
class: PHPStan\Rules\PhpDoc\ConditionalReturnTypeRuleHelper
1029-
1030905
-
1031906
class: PHPStan\Rules\PhpDoc\AssertRuleHelper
1032907
arguments:
1033908
checkMissingTypehints: %checkMissingTypehints%
1034909
checkClassCaseSensitivity: %checkClassCaseSensitivity%
1035910

1036-
-
1037-
class: PHPStan\Rules\PhpDoc\UnresolvableTypeHelper
1038-
1039-
-
1040-
class: PHPStan\Rules\PhpDoc\GenericCallableRuleHelper
1041-
1042-
-
1043-
class: PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeCheck
1044-
1045911
-
1046912
class: PHPStan\Rules\PhpDoc\VarTagTypeRuleHelper
1047913
arguments:
1048914
checkTypeAgainstPhpDocType: %reportWrongPhpDocTypeInVarTag%
1049915
strictWideningCheck: %reportAnyTypeWideningInVarTag%
1050916

1051-
-
1052-
class: PHPStan\Rules\Playground\NeverRuleHelper
1053-
1054917
-
1055918
class: PHPStan\Rules\Properties\AccessPropertiesCheck
1056919
arguments:
@@ -1060,12 +923,6 @@ services:
1060923
-
1061924
class: PHPStan\Rules\Properties\UninitializedPropertyRule
1062925

1063-
-
1064-
class: PHPStan\Rules\Properties\LazyReadWritePropertiesExtensionProvider
1065-
1066-
-
1067-
class: PHPStan\Rules\Properties\PropertyDescriptor
1068-
1069926
-
1070927
class: PHPStan\Rules\RuleLevelHelper
1071928
arguments:

src/Analyser/ConstantResolverFactory.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 PHPStan\DependencyInjection\Container;
67
use PHPStan\Php\ComposerPhpVersionFactory;
78
use PHPStan\Reflection\ReflectionProvider\ReflectionProviderProvider;
89

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

src/Analyser/Ignore/IgnoreLexer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
use Nette\Utils\Strings;
66
use PHPStan\Analyser\Error;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use function implode;
89
use const PREG_SET_ORDER;
910

11+
#[AutowiredService]
1012
final class IgnoreLexer
1113
{
1214

src/Analyser/IgnoreErrorExtensionProvider.php

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

33
namespace PHPStan\Analyser;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\DependencyInjection\Container;
67

8+
#[AutowiredService]
79
final class IgnoreErrorExtensionProvider
810
{
911

src/Analyser/LocalIgnoresProcessor.php

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

33
namespace PHPStan\Analyser;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use function array_key_exists;
67
use function array_values;
78
use function count;
@@ -10,6 +11,7 @@
1011
/**
1112
* @phpstan-import-type LinesToIgnore from FileAnalyserResult
1213
*/
14+
#[AutowiredService]
1315
final class LocalIgnoresProcessor
1416
{
1517

src/Analyser/RicherScopeGetTypeHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use PhpParser\Node;
66
use PhpParser\Node\Expr\BinaryOp\Identical;
77
use PhpParser\Node\Expr\Variable;
8+
use PHPStan\DependencyInjection\AutowiredService;
89
use PHPStan\Reflection\InitializerExprTypeResolver;
910
use PHPStan\Type\BooleanType;
1011
use PHPStan\Type\Constant\ConstantBooleanType;
1112
use PHPStan\Type\TypeResult;
1213
use function is_string;
1314

15+
#[AutowiredService]
1416
final class RicherScopeGetTypeHelper
1517
{
1618

src/Analyser/RuleErrorTransformer.php

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

55
use PhpParser\Node;
6+
use PHPStan\DependencyInjection\AutowiredService;
67
use PHPStan\Rules\FileRuleError;
78
use PHPStan\Rules\IdentifierRuleError;
89
use PHPStan\Rules\LineRuleError;
@@ -11,6 +12,7 @@
1112
use PHPStan\Rules\RuleError;
1213
use PHPStan\Rules\TipRuleError;
1314

15+
#[AutowiredService]
1416
final class RuleErrorTransformer
1517
{
1618

src/Analyser/ScopeFactory.php

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

33
namespace PHPStan\Analyser;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
6+
57
/**
68
* @api
79
*/
10+
#[AutowiredService]
811
final class ScopeFactory
912
{
1013

0 commit comments

Comments
 (0)