@@ -36,15 +36,24 @@ class DataProviderDeclarationRule implements Rule
36
36
*/
37
37
private $ checkFunctionNameCase ;
38
38
39
+ /**
40
+ * When phpstan-deprecation-rules is installed, it reports deprecated usages.
41
+ *
42
+ * @var bool
43
+ */
44
+ private $ deprecationRulesInstalled ;
45
+
39
46
public function __construct (
40
47
DataProviderHelper $ dataProviderHelper ,
41
48
FileTypeMapper $ fileTypeMapper ,
42
- bool $ checkFunctionNameCase
49
+ bool $ checkFunctionNameCase ,
50
+ bool $ deprecationRulesInstalled
43
51
)
44
52
{
45
53
$ this ->dataProviderHelper = $ dataProviderHelper ;
46
54
$ this ->fileTypeMapper = $ fileTypeMapper ;
47
55
$ this ->checkFunctionNameCase = $ checkFunctionNameCase ;
56
+ $ this ->deprecationRulesInstalled = $ deprecationRulesInstalled ;
48
57
}
49
58
50
59
public function getNodeType (): string
@@ -80,7 +89,12 @@ public function processNode(Node $node, Scope $scope): array
80
89
foreach ($ annotations as $ annotation ) {
81
90
$ errors = array_merge (
82
91
$ errors ,
83
- $ this ->dataProviderHelper ->processDataProvider ($ scope , $ annotation , $ this ->checkFunctionNameCase )
92
+ $ this ->dataProviderHelper ->processDataProvider (
93
+ $ scope ,
94
+ $ annotation ,
95
+ $ this ->checkFunctionNameCase ,
96
+ $ this ->deprecationRulesInstalled
97
+ )
84
98
);
85
99
}
86
100
0 commit comments