File tree Expand file tree Collapse file tree 10 files changed +30
-51
lines changed
Expand file tree Collapse file tree 10 files changed +30
-51
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,3 @@ parameters:
1010autowiredAttributeServices :
1111 # registers rules with #[RegisteredRule] attribute
1212 level : 1
13-
14- services :
15- -
16- class : PHPStan\Rules\Constants\ConstantRule
17- tags :
18- - phpstan.rules.rule
19- arguments :
20- discoveringSymbolsTip : %tips.discoveringSymbols%
Original file line number Diff line number Diff line change @@ -17,49 +17,6 @@ conditionalTags:
1717 phpstan.restrictedMethodUsageExtension : %featureToggles.internalTag%
1818
1919services :
20- -
21- class : PHPStan\Rules\Classes\MixinRule
22- tags :
23- - phpstan.rules.rule
24-
25- -
26- class : PHPStan\Rules\PhpDoc\RequireExtendsCheck
27- arguments :
28- checkClassCaseSensitivity : %checkClassCaseSensitivity%
29- discoveringSymbolsTip : %tips.discoveringSymbols%
30-
31- -
32- class : PHPStan\Rules\PhpDoc\RequireImplementsDefinitionTraitRule
33- arguments :
34- checkClassCaseSensitivity : %checkClassCaseSensitivity%
35- discoveringSymbolsTip : %tips.discoveringSymbols%
36- tags :
37- - phpstan.rules.rule
38-
39- -
40- class : PHPStan\Rules\Functions\CallCallablesRule
41- arguments :
42- reportMaybes : %reportMaybes%
43- tags :
44- - phpstan.rules.rule
45-
46- -
47- class : PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule
48- tags :
49- - phpstan.rules.rule
50- -
51- class : PHPStan\Rules\PhpDoc\InvalidPhpDocVarTagTypeRule
52- arguments :
53- checkClassCaseSensitivity : %checkClassCaseSensitivity%
54- checkMissingVarTagTypehint : %checkMissingVarTagTypehint%
55- discoveringSymbolsTip : %tips.discoveringSymbols%
56- tags :
57- - phpstan.rules.rule
58- -
59- class : PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule
60- tags :
61- - phpstan.rules.rule
62-
6320 -
6421 class : PHPStan\Rules\InternalTag\RestrictedInternalPropertyUsageExtension
6522
Original file line number Diff line number Diff line change 44
55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
7+ use PHPStan \DependencyInjection \RegisteredRule ;
78use PHPStan \Node \InClassNode ;
89use PHPStan \Rules \Rule ;
910
1011/**
1112 * @implements Rule<InClassNode>
1213 */
14+ #[RegisteredRule(level: 2 )]
1315final class MixinRule implements Rule
1416{
1517
Original file line number Diff line number Diff line change 44
55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
7+ use PHPStan \DependencyInjection \AutowiredParameter ;
8+ use PHPStan \DependencyInjection \RegisteredRule ;
79use PHPStan \Rules \Rule ;
810use PHPStan \Rules \RuleErrorBuilder ;
911use function sprintf ;
1012
1113/**
1214 * @implements Rule<Node\Expr\ConstFetch>
1315 */
16+ #[RegisteredRule(level: 1 )]
1417final class ConstantRule implements Rule
1518{
1619
1720 public function __construct (
21+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
1822 private bool $ discoveringSymbolsTip ,
1923 )
2024 {
Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PHPStan \Analyser \NullsafeOperatorHelper ;
77use PHPStan \Analyser \Scope ;
8+ use PHPStan \DependencyInjection \AutowiredParameter ;
9+ use PHPStan \DependencyInjection \RegisteredRule ;
810use PHPStan \Internal \SprintfHelper ;
911use PHPStan \Reflection \InaccessibleMethod ;
1012use PHPStan \Reflection \ParametersAcceptorSelector ;
2527/**
2628 * @implements Rule<Node\Expr\FuncCall>
2729 */
30+ #[RegisteredRule(level: 2 )]
2831final class CallCallablesRule implements Rule
2932{
3033
3134 public function __construct (
3235 private FunctionCallParametersCheck $ check ,
3336 private RuleLevelHelper $ ruleLevelHelper ,
37+ #[AutowiredParameter]
3438 private bool $ reportMaybes ,
3539 )
3640 {
Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PhpParser \NodeAbstract ;
77use PHPStan \Analyser \Scope ;
8+ use PHPStan \DependencyInjection \RegisteredRule ;
89use PHPStan \Node \VirtualNode ;
910use PHPStan \PhpDocParser \Lexer \Lexer ;
1011use PHPStan \PhpDocParser \Parser \PhpDocParser ;
1819/**
1920 * @implements Rule<NodeAbstract>
2021 */
22+ #[RegisteredRule(level: 2 )]
2123final class InvalidPHPStanDocTagRule implements Rule
2224{
2325
Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PhpParser \NodeAbstract ;
77use PHPStan \Analyser \Scope ;
8+ use PHPStan \DependencyInjection \RegisteredRule ;
89use PHPStan \Node \VirtualNode ;
910use PHPStan \PhpDocParser \Ast \PhpDoc \InvalidTagValueNode ;
1011use PHPStan \PhpDocParser \Ast \PhpDoc \TypeAliasTagValueNode ;
2021/**
2122 * @implements Rule<NodeAbstract>
2223 */
24+ #[RegisteredRule(level: 2 )]
2325final class InvalidPhpDocTagValueRule implements Rule
2426{
2527
Original file line number Diff line number Diff line change 44
55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
7+ use PHPStan \DependencyInjection \AutowiredParameter ;
8+ use PHPStan \DependencyInjection \RegisteredRule ;
79use PHPStan \Internal \SprintfHelper ;
810use PHPStan \Reflection \ReflectionProvider ;
911use PHPStan \Rules \ClassNameCheck ;
2325/**
2426 * @implements Rule<Node\Stmt>
2527 */
28+ #[RegisteredRule(level: 2 )]
2629final class InvalidPhpDocVarTagTypeRule implements Rule
2730{
2831
@@ -33,8 +36,11 @@ public function __construct(
3336 private GenericObjectTypeCheck $ genericObjectTypeCheck ,
3437 private MissingTypehintCheck $ missingTypehintCheck ,
3538 private UnresolvableTypeHelper $ unresolvableTypeHelper ,
39+ #[AutowiredParameter]
3640 private bool $ checkClassCaseSensitivity ,
41+ #[AutowiredParameter]
3742 private bool $ checkMissingVarTagTypehint ,
43+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
3844 private bool $ discoveringSymbolsTip ,
3945 )
4046 {
Original file line number Diff line number Diff line change 44
55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
7+ use PHPStan \DependencyInjection \AutowiredParameter ;
8+ use PHPStan \DependencyInjection \AutowiredService ;
79use PHPStan \PhpDoc \Tag \RequireExtendsTag ;
810use PHPStan \Rules \ClassNameCheck ;
911use PHPStan \Rules \ClassNameNodePair ;
1921use function sprintf ;
2022use function strtolower ;
2123
24+ #[AutowiredService]
2225final class RequireExtendsCheck
2326{
2427
2528 public function __construct (
2629 private ClassNameCheck $ classCheck ,
30+ #[AutowiredParameter]
2731 private bool $ checkClassCaseSensitivity ,
32+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
2833 private bool $ discoveringSymbolsTip ,
2934 )
3035 {
Original file line number Diff line number Diff line change 44
55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
7+ use PHPStan \DependencyInjection \AutowiredParameter ;
8+ use PHPStan \DependencyInjection \RegisteredRule ;
79use PHPStan \Reflection \ReflectionProvider ;
810use PHPStan \Rules \ClassNameCheck ;
911use PHPStan \Rules \ClassNameNodePair ;
2123/**
2224 * @implements Rule<Node\Stmt\Trait_>
2325 */
26+ #[RegisteredRule(level: 2 )]
2427final class RequireImplementsDefinitionTraitRule implements Rule
2528{
2629
2730 public function __construct (
2831 private ReflectionProvider $ reflectionProvider ,
2932 private ClassNameCheck $ classCheck ,
33+ #[AutowiredParameter]
3034 private bool $ checkClassCaseSensitivity ,
35+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
3136 private bool $ discoveringSymbolsTip ,
3237 )
3338 {
You can’t perform that action at this time.
0 commit comments