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:
10
10
autowiredAttributeServices :
11
11
# registers rules with #[RegisteredRule] attribute
12
12
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:
17
17
phpstan.restrictedMethodUsageExtension : %featureToggles.internalTag%
18
18
19
19
services :
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
-
63
20
-
64
21
class : PHPStan\Rules\InternalTag\RestrictedInternalPropertyUsageExtension
65
22
Original file line number Diff line number Diff line change 4
4
5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \Scope ;
7
+ use PHPStan \DependencyInjection \RegisteredRule ;
7
8
use PHPStan \Node \InClassNode ;
8
9
use PHPStan \Rules \Rule ;
9
10
10
11
/**
11
12
* @implements Rule<InClassNode>
12
13
*/
14
+ #[RegisteredRule(level: 2 )]
13
15
final class MixinRule implements Rule
14
16
{
15
17
Original file line number Diff line number Diff line change 4
4
5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \Scope ;
7
+ use PHPStan \DependencyInjection \AutowiredParameter ;
8
+ use PHPStan \DependencyInjection \RegisteredRule ;
7
9
use PHPStan \Rules \Rule ;
8
10
use PHPStan \Rules \RuleErrorBuilder ;
9
11
use function sprintf ;
10
12
11
13
/**
12
14
* @implements Rule<Node\Expr\ConstFetch>
13
15
*/
16
+ #[RegisteredRule(level: 1 )]
14
17
final class ConstantRule implements Rule
15
18
{
16
19
17
20
public function __construct (
21
+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
18
22
private bool $ discoveringSymbolsTip ,
19
23
)
20
24
{
Original file line number Diff line number Diff line change 5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \NullsafeOperatorHelper ;
7
7
use PHPStan \Analyser \Scope ;
8
+ use PHPStan \DependencyInjection \AutowiredParameter ;
9
+ use PHPStan \DependencyInjection \RegisteredRule ;
8
10
use PHPStan \Internal \SprintfHelper ;
9
11
use PHPStan \Reflection \InaccessibleMethod ;
10
12
use PHPStan \Reflection \ParametersAcceptorSelector ;
25
27
/**
26
28
* @implements Rule<Node\Expr\FuncCall>
27
29
*/
30
+ #[RegisteredRule(level: 2 )]
28
31
final class CallCallablesRule implements Rule
29
32
{
30
33
31
34
public function __construct (
32
35
private FunctionCallParametersCheck $ check ,
33
36
private RuleLevelHelper $ ruleLevelHelper ,
37
+ #[AutowiredParameter]
34
38
private bool $ reportMaybes ,
35
39
)
36
40
{
Original file line number Diff line number Diff line change 5
5
use PhpParser \Node ;
6
6
use PhpParser \NodeAbstract ;
7
7
use PHPStan \Analyser \Scope ;
8
+ use PHPStan \DependencyInjection \RegisteredRule ;
8
9
use PHPStan \Node \VirtualNode ;
9
10
use PHPStan \PhpDocParser \Lexer \Lexer ;
10
11
use PHPStan \PhpDocParser \Parser \PhpDocParser ;
18
19
/**
19
20
* @implements Rule<NodeAbstract>
20
21
*/
22
+ #[RegisteredRule(level: 2 )]
21
23
final class InvalidPHPStanDocTagRule implements Rule
22
24
{
23
25
Original file line number Diff line number Diff line change 5
5
use PhpParser \Node ;
6
6
use PhpParser \NodeAbstract ;
7
7
use PHPStan \Analyser \Scope ;
8
+ use PHPStan \DependencyInjection \RegisteredRule ;
8
9
use PHPStan \Node \VirtualNode ;
9
10
use PHPStan \PhpDocParser \Ast \PhpDoc \InvalidTagValueNode ;
10
11
use PHPStan \PhpDocParser \Ast \PhpDoc \TypeAliasTagValueNode ;
20
21
/**
21
22
* @implements Rule<NodeAbstract>
22
23
*/
24
+ #[RegisteredRule(level: 2 )]
23
25
final class InvalidPhpDocTagValueRule implements Rule
24
26
{
25
27
Original file line number Diff line number Diff line change 4
4
5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \Scope ;
7
+ use PHPStan \DependencyInjection \AutowiredParameter ;
8
+ use PHPStan \DependencyInjection \RegisteredRule ;
7
9
use PHPStan \Internal \SprintfHelper ;
8
10
use PHPStan \Reflection \ReflectionProvider ;
9
11
use PHPStan \Rules \ClassNameCheck ;
23
25
/**
24
26
* @implements Rule<Node\Stmt>
25
27
*/
28
+ #[RegisteredRule(level: 2 )]
26
29
final class InvalidPhpDocVarTagTypeRule implements Rule
27
30
{
28
31
@@ -33,8 +36,11 @@ public function __construct(
33
36
private GenericObjectTypeCheck $ genericObjectTypeCheck ,
34
37
private MissingTypehintCheck $ missingTypehintCheck ,
35
38
private UnresolvableTypeHelper $ unresolvableTypeHelper ,
39
+ #[AutowiredParameter]
36
40
private bool $ checkClassCaseSensitivity ,
41
+ #[AutowiredParameter]
37
42
private bool $ checkMissingVarTagTypehint ,
43
+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
38
44
private bool $ discoveringSymbolsTip ,
39
45
)
40
46
{
Original file line number Diff line number Diff line change 4
4
5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \Scope ;
7
+ use PHPStan \DependencyInjection \AutowiredParameter ;
8
+ use PHPStan \DependencyInjection \AutowiredService ;
7
9
use PHPStan \PhpDoc \Tag \RequireExtendsTag ;
8
10
use PHPStan \Rules \ClassNameCheck ;
9
11
use PHPStan \Rules \ClassNameNodePair ;
19
21
use function sprintf ;
20
22
use function strtolower ;
21
23
24
+ #[AutowiredService]
22
25
final class RequireExtendsCheck
23
26
{
24
27
25
28
public function __construct (
26
29
private ClassNameCheck $ classCheck ,
30
+ #[AutowiredParameter]
27
31
private bool $ checkClassCaseSensitivity ,
32
+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
28
33
private bool $ discoveringSymbolsTip ,
29
34
)
30
35
{
Original file line number Diff line number Diff line change 4
4
5
5
use PhpParser \Node ;
6
6
use PHPStan \Analyser \Scope ;
7
+ use PHPStan \DependencyInjection \AutowiredParameter ;
8
+ use PHPStan \DependencyInjection \RegisteredRule ;
7
9
use PHPStan \Reflection \ReflectionProvider ;
8
10
use PHPStan \Rules \ClassNameCheck ;
9
11
use PHPStan \Rules \ClassNameNodePair ;
21
23
/**
22
24
* @implements Rule<Node\Stmt\Trait_>
23
25
*/
26
+ #[RegisteredRule(level: 2 )]
24
27
final class RequireImplementsDefinitionTraitRule implements Rule
25
28
{
26
29
27
30
public function __construct (
28
31
private ReflectionProvider $ reflectionProvider ,
29
32
private ClassNameCheck $ classCheck ,
33
+ #[AutowiredParameter]
30
34
private bool $ checkClassCaseSensitivity ,
35
+ #[AutowiredParameter(ref: '%tips.discoveringSymbols% ' )]
31
36
private bool $ discoveringSymbolsTip ,
32
37
)
33
38
{
You can’t perform that action at this time.
0 commit comments