Skip to content

Commit 8b2d4f1

Browse files
committed
more autowire
1 parent 2908da6 commit 8b2d4f1

24 files changed

+46
-68
lines changed

conf/config.neon

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -913,15 +913,6 @@ services:
913913
autowired:
914914
- PHPStan\Rules\Exceptions\DefaultExceptionTypeResolver
915915

916-
-
917-
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInFunctionThrowsRule
918-
919-
-
920-
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInMethodThrowsRule
921-
922-
-
923-
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInPropertyHookThrowsRule
924-
925916
-
926917
class: PHPStan\Rules\Exceptions\MissingCheckedExceptionInThrowsCheck
927918
arguments:
@@ -946,37 +937,17 @@ services:
946937
checkClassCaseSensitivity: %checkClassCaseSensitivity%
947938
checkThisOnly: %checkThisOnly%
948939

949-
-
950-
class: PHPStan\Rules\FunctionReturnTypeCheck
951-
-
952-
class: PHPStan\Rules\ParameterCastableToStringCheck
953-
954-
-
955-
class: PHPStan\Rules\Generics\CrossCheckInterfacesHelper
956-
957940
-
958941
class: PHPStan\Rules\Generics\GenericAncestorsCheck
959942
arguments:
960943
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%
961944
checkMissingTypehints: %checkMissingTypehints%
962945

963-
-
964-
class: PHPStan\Rules\Generics\GenericObjectTypeCheck
965-
966-
-
967-
class: PHPStan\Rules\Generics\MethodTagTemplateTypeCheck
968-
969946
-
970947
class: PHPStan\Rules\Generics\TemplateTypeCheck
971948
arguments:
972949
checkClassCaseSensitivity: %checkClassCaseSensitivity%
973950

974-
-
975-
class: PHPStan\Rules\Generics\VarianceCheck
976-
977-
-
978-
class: PHPStan\Rules\InternalTag\RestrictedInternalUsageHelper
979-
980951
-
981952
class: PHPStan\Rules\IssetCheck
982953
arguments:
@@ -1003,69 +974,30 @@ services:
1003974
reportMaybes: %reportMaybesInMethodSignatures%
1004975
reportStatic: %reportStaticMethodSignatures%
1005976

1006-
-
1007-
class: PHPStan\Rules\Methods\MethodParameterComparisonHelper
1008-
1009-
-
1010-
class: PHPStan\Rules\Methods\MethodVisibilityComparisonHelper
1011-
1012977
-
1013978
class: PHPStan\Rules\MissingTypehintCheck
1014979
arguments:
1015980
checkMissingCallableSignature: %checkMissingCallableSignature%
1016981
skipCheckGenericClasses: %featureToggles.skipCheckGenericClasses%
1017982

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-
1030983
-
1031984
class: PHPStan\Rules\PhpDoc\AssertRuleHelper
1032985
arguments:
1033986
checkMissingTypehints: %checkMissingTypehints%
1034987
checkClassCaseSensitivity: %checkClassCaseSensitivity%
1035988

1036-
-
1037-
class: PHPStan\Rules\PhpDoc\UnresolvableTypeHelper
1038-
1039-
-
1040-
class: PHPStan\Rules\PhpDoc\GenericCallableRuleHelper
1041-
1042-
-
1043-
class: PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeCheck
1044-
1045989
-
1046990
class: PHPStan\Rules\PhpDoc\VarTagTypeRuleHelper
1047991
arguments:
1048992
checkTypeAgainstPhpDocType: %reportWrongPhpDocTypeInVarTag%
1049993
strictWideningCheck: %reportAnyTypeWideningInVarTag%
1050994

1051-
-
1052-
class: PHPStan\Rules\Playground\NeverRuleHelper
1053-
1054995
-
1055996
class: PHPStan\Rules\Properties\AccessPropertiesCheck
1056997
arguments:
1057998
reportMagicProperties: %reportMagicProperties%
1058999
checkDynamicProperties: %checkDynamicProperties%
10591000

1060-
-
1061-
class: PHPStan\Rules\Properties\UninitializedPropertyRule
1062-
1063-
-
1064-
class: PHPStan\Rules\Properties\LazyReadWritePropertiesExtensionProvider
1065-
1066-
-
1067-
class: PHPStan\Rules\Properties\PropertyDescriptor
1068-
10691001
-
10701002
class: PHPStan\Rules\RuleLevelHelper
10711003
arguments:

src/Rules/Constants/LazyAlwaysUsedClassConstantsExtensionProvider.php

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

33
namespace PHPStan\Rules\Constants;
44

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

8+
#[AutowiredService]
79
final class LazyAlwaysUsedClassConstantsExtensionProvider implements AlwaysUsedClassConstantsExtensionProvider
810
{
911

src/Rules/Exceptions/MissingCheckedExceptionInFunctionThrowsRule.php

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

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Node\FunctionReturnStatementsNode;
89
use PHPStan\Rules\Rule;
910
use PHPStan\Rules\RuleErrorBuilder;
@@ -12,6 +13,7 @@
1213
/**
1314
* @implements Rule<FunctionReturnStatementsNode>
1415
*/
16+
#[AutowiredService]
1517
final class MissingCheckedExceptionInFunctionThrowsRule implements Rule
1618
{
1719

src/Rules/Exceptions/MissingCheckedExceptionInMethodThrowsRule.php

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

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Node\MethodReturnStatementsNode;
89
use PHPStan\Rules\Rule;
910
use PHPStan\Rules\RuleErrorBuilder;
@@ -12,6 +13,7 @@
1213
/**
1314
* @implements Rule<MethodReturnStatementsNode>
1415
*/
16+
#[AutowiredService]
1517
final class MissingCheckedExceptionInMethodThrowsRule implements Rule
1618
{
1719

src/Rules/Exceptions/MissingCheckedExceptionInPropertyHookThrowsRule.php

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

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Node\PropertyHookReturnStatementsNode;
89
use PHPStan\Rules\Rule;
910
use PHPStan\Rules\RuleErrorBuilder;
@@ -14,6 +15,7 @@
1415
/**
1516
* @implements Rule<PropertyHookReturnStatementsNode>
1617
*/
18+
#[AutowiredService]
1719
final class MissingCheckedExceptionInPropertyHookThrowsRule implements Rule
1820
{
1921

src/Rules/FunctionReturnTypeCheck.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
use PhpParser\Node;
77
use PhpParser\Node\Expr;
88
use PHPStan\Analyser\Scope;
9+
use PHPStan\DependencyInjection\AutowiredService;
910
use PHPStan\Type\ErrorType;
1011
use PHPStan\Type\NeverType;
1112
use PHPStan\Type\Type;
1213
use PHPStan\Type\TypeUtils;
1314
use PHPStan\Type\VerbosityLevel;
1415
use function sprintf;
1516

17+
#[AutowiredService]
1618
final class FunctionReturnTypeCheck
1719
{
1820

src/Rules/Generics/CrossCheckInterfacesHelper.php

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

33
namespace PHPStan\Rules\Generics;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Reflection\ClassReflection;
67
use PHPStan\Rules\IdentifierRuleError;
78
use PHPStan\Rules\RuleErrorBuilder;
89
use PHPStan\Type\VerbosityLevel;
910
use function array_key_exists;
1011
use function sprintf;
1112

13+
#[AutowiredService]
1214
final class CrossCheckInterfacesHelper
1315
{
1416

src/Rules/Generics/GenericObjectTypeCheck.php

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

33
namespace PHPStan\Rules\Generics;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Rules\IdentifierRuleError;
67
use PHPStan\Rules\RuleErrorBuilder;
78
use PHPStan\ShouldNotHappenException;
@@ -23,6 +24,7 @@
2324
use function sprintf;
2425
use function strtolower;
2526

27+
#[AutowiredService]
2628
final class GenericObjectTypeCheck
2729
{
2830

src/Rules/Generics/MethodTagTemplateTypeCheck.php

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

55
use PhpParser\Node\Stmt\ClassLike;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Internal\SprintfHelper;
89
use PHPStan\Reflection\ClassReflection;
910
use PHPStan\Rules\IdentifierRuleError;
@@ -15,6 +16,7 @@
1516
use function array_merge;
1617
use function sprintf;
1718

19+
#[AutowiredService]
1820
final class MethodTagTemplateTypeCheck
1921
{
2022

src/Rules/Generics/VarianceCheck.php

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

33
namespace PHPStan\Rules\Generics;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Reflection\ExtendedParametersAcceptor;
67
use PHPStan\Rules\IdentifierRuleError;
78
use PHPStan\Rules\RuleErrorBuilder;
@@ -10,6 +11,7 @@
1011
use PHPStan\Type\Type;
1112
use function sprintf;
1213

14+
#[AutowiredService]
1315
final class VarianceCheck
1416
{
1517

src/Rules/InternalTag/RestrictedInternalUsageHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
namespace PHPStan\Rules\InternalTag;
44

55
use PHPStan\Analyser\Scope;
6+
use PHPStan\DependencyInjection\AutowiredService;
67
use function array_slice;
78
use function explode;
89
use function str_starts_with;
910

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

src/Rules/Methods/LazyAlwaysUsedMethodExtensionProvider.php

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

33
namespace PHPStan\Rules\Methods;
44

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

8+
#[AutowiredService]
79
final class LazyAlwaysUsedMethodExtensionProvider implements AlwaysUsedMethodExtensionProvider
810
{
911

src/Rules/Methods/MethodParameterComparisonHelper.php

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

33
namespace PHPStan\Rules\Methods;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Php\PhpVersion;
67
use PHPStan\Reflection\ClassReflection;
78
use PHPStan\Reflection\ExtendedMethodReflection;
@@ -21,6 +22,7 @@
2122
use function count;
2223
use function sprintf;
2324

25+
#[AutowiredService]
2426
final class MethodParameterComparisonHelper
2527
{
2628

src/Rules/Methods/MethodVisibilityComparisonHelper.php

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

33
namespace PHPStan\Rules\Methods;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Reflection\ClassReflection;
67
use PHPStan\Reflection\ExtendedMethodReflection;
78
use PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection;
89
use PHPStan\Rules\IdentifierRuleError;
910
use PHPStan\Rules\RuleErrorBuilder;
1011
use function sprintf;
1112

13+
#[AutowiredService]
1214
final class MethodVisibilityComparisonHelper
1315
{
1416

src/Rules/NullsafeCheck.php

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

55
use PhpParser\Node\Expr;
6+
use PHPStan\DependencyInjection\AutowiredService;
67

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

src/Rules/ParameterCastableToStringCheck.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use PhpParser\Node\Arg;
66
use PHPStan\Analyser\ArgumentsNormalizer;
77
use PHPStan\Analyser\Scope;
8+
use PHPStan\DependencyInjection\AutowiredService;
89
use PHPStan\Reflection\ParameterReflection;
910
use PHPStan\Type\ErrorType;
1011
use PHPStan\Type\Type;
1112
use PHPStan\Type\VerbosityLevel;
1213
use function sprintf;
1314

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

src/Rules/PhpDoc/ConditionalReturnTypeRuleHelper.php

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

33
namespace PHPStan\Rules\PhpDoc;
44

5+
use PHPStan\DependencyInjection\AutowiredService;
56
use PHPStan\Reflection\ExtendedParametersAcceptor;
67
use PHPStan\Rules\IdentifierRuleError;
78
use PHPStan\Rules\RuleErrorBuilder;
@@ -17,6 +18,7 @@
1718
use function sprintf;
1819
use function substr;
1920

21+
#[AutowiredService]
2022
final class ConditionalReturnTypeRuleHelper
2123
{
2224

src/Rules/PhpDoc/GenericCallableRuleHelper.php

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

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\PhpDoc\Tag\TemplateTag;
89
use PHPStan\Reflection\ClassReflection;
910
use PHPStan\Rules\Generics\TemplateTypeCheck;
@@ -18,6 +19,7 @@
1819
use function array_keys;
1920
use function sprintf;
2021

22+
#[AutowiredService]
2123
final class GenericCallableRuleHelper
2224
{
2325

src/Rules/PhpDoc/IncompatiblePhpDocTypeCheck.php

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

55
use PhpParser\Node;
66
use PHPStan\Analyser\Scope;
7+
use PHPStan\DependencyInjection\AutowiredService;
78
use PHPStan\Internal\SprintfHelper;
89
use PHPStan\PhpDoc\ResolvedPhpDocBlock;
910
use PHPStan\PhpDoc\Tag\ParamOutTag;
@@ -19,6 +20,7 @@
1920
use function in_array;
2021
use function sprintf;
2122

23+
#[AutowiredService]
2224
final class IncompatiblePhpDocTypeCheck
2325
{
2426

0 commit comments

Comments
 (0)