From 73233a0c6be8c23c99a002ba4ff5d870064e3f4b Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 30 Jun 2024 11:18:05 +0700 Subject: [PATCH] Fix prefixed scoped DataProvider class on NamedArgumentForDataProviderRector (#347) * Fix prefixed scoped DataProvider class on NamedArgumentForDataProviderRector * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action --- .../Rector/Class_/NamedArgumentForDataProviderRector.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rules/PHPUnit110/Rector/Class_/NamedArgumentForDataProviderRector.php b/rules/PHPUnit110/Rector/Class_/NamedArgumentForDataProviderRector.php index 2c30bc7f..5571a068 100644 --- a/rules/PHPUnit110/Rector/Class_/NamedArgumentForDataProviderRector.php +++ b/rules/PHPUnit110/Rector/Class_/NamedArgumentForDataProviderRector.php @@ -14,7 +14,6 @@ use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Return_; -use PHPUnit\Framework\Attributes\DataProvider; use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; @@ -184,7 +183,7 @@ public function getResolvedVariables(array $stmts): array private function getDataProviderMethodName(ClassMethod $classMethod): string|null { - $attributeClassName = DataProvider::class; + $attributeClassName = 'PHPUnit\Framework\Attributes\DataProvider'; foreach ($classMethod->attrGroups as $attributeGroup) { foreach ($attributeGroup->attrs as $attribute) { if (! $this->isName($attribute->name, $attributeClassName)) {