@@ -36,15 +36,24 @@ class DataProviderDeclarationRule implements Rule
3636 */
3737 private $ checkFunctionNameCase ;
3838
39+ /**
40+ * When phpstan-deprecation-rules is installed, it reports deprecated usages.
41+ *
42+ * @var bool
43+ */
44+ private $ deprecationRulesInstalled ;
45+
3946 public function __construct (
4047 DataProviderHelper $ dataProviderHelper ,
4148 FileTypeMapper $ fileTypeMapper ,
42- bool $ checkFunctionNameCase
49+ bool $ checkFunctionNameCase ,
50+ bool $ deprecationRulesInstalled
4351 )
4452 {
4553 $ this ->dataProviderHelper = $ dataProviderHelper ;
4654 $ this ->fileTypeMapper = $ fileTypeMapper ;
4755 $ this ->checkFunctionNameCase = $ checkFunctionNameCase ;
56+ $ this ->deprecationRulesInstalled = $ deprecationRulesInstalled ;
4857 }
4958
5059 public function getNodeType (): string
@@ -80,7 +89,12 @@ public function processNode(Node $node, Scope $scope): array
8089 foreach ($ annotations as $ annotation ) {
8190 $ errors = array_merge (
8291 $ errors ,
83- $ this ->dataProviderHelper ->processDataProvider ($ scope , $ annotation , $ this ->checkFunctionNameCase )
92+ $ this ->dataProviderHelper ->processDataProvider (
93+ $ scope ,
94+ $ annotation ,
95+ $ this ->checkFunctionNameCase ,
96+ $ this ->deprecationRulesInstalled
97+ )
8498 );
8599 }
86100
0 commit comments