22
33declare (strict_types=1 );
44
5- namespace Symplify \PHPStanRules \PHPStan \ Rule ;
5+ namespace Symplify \PHPStanRules \Rules \ PHPUnit ;
66
77use PhpParser \Node ;
88use PhpParser \Node \Stmt \ClassMethod ;
99use PHPStan \Analyser \Scope ;
1010use PHPStan \Node \InClassNode ;
1111use PHPStan \Rules \Rule ;
1212use PHPStan \Rules \RuleErrorBuilder ;
13- use Symplify \PHPStanRules \PHPStan \ DataProviderMethodResolver ;
14- use Symplify \PHPStanRules \PHPStan \ PHPUnitTestAnalyser ;
13+ use Symplify \PHPStanRules \Enum \ RuleIdentifier ;
14+ use Symplify \PHPStanRules \PHPUnit \ DataProviderMethodResolver ;
1515
1616/**
1717 * PHPUnit data provider have to be public and static
@@ -42,15 +42,15 @@ public function getNodeType(): string
4242 */
4343 public function processNode (Node $ node , Scope $ scope ): array
4444 {
45- if (! PHPUnitTestAnalyser::isTestClass ($ scope )) {
45+ if (! \ Symplify \ PHPStanRules \ Testing \ PHPUnitTestAnalyser::isTestClass ($ scope )) {
4646 return [];
4747 }
4848
4949 $ ruleErrors = [];
5050
5151 $ classLike = $ node ->getOriginalNode ();
5252 foreach ($ classLike ->getMethods () as $ classMethod ) {
53- if (! PHPUnitTestAnalyser::isTestClassMethod ($ classMethod )) {
53+ if (! \ Symplify \ PHPStanRules \ Testing \ PHPUnitTestAnalyser::class ::isTestClassMethod ($ classMethod )) {
5454 continue ;
5555 }
5656
@@ -75,7 +75,7 @@ public function processNode(Node $node, Scope $scope): array
7575 if (! $ dataProviderClassMethod ->isStatic ()) {
7676 $ errorMessage = sprintf (self ::PUBLIC_ERROR_MESSAGE , $ dataProviderMethodName );
7777 $ ruleErrors [] = RuleErrorBuilder::message ($ errorMessage )
78- ->identifier (' phpunit.publicDataProvider ' )
78+ ->identifier (RuleIdentifier:: PHPUNIT_PUBLIC_STATIC_DATA_PROVIDER )
7979 ->line ($ dataProviderClassMethod ->getLine ())
8080 ->build ();
8181 }
0 commit comments