Skip to content

Commit 8bfa606

Browse files
authored
Fix target method on dataProvider on DataProviderAnnotationToAttributeRector (#524)
1 parent 840f08b commit 8bfa606

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rules-tests/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector/Fixture/already_in_use.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use PHPUnit\Framework\TestCase;
2626

2727
final class AlreadyInUse extends TestCase
2828
{
29-
#[\PHPUnit\Framework\Attributes\DataProvider('@dataProvider')]
29+
#[\PHPUnit\Framework\Attributes\DataProvider('someMethod')]
3030
public function test(): void
3131
{
3232
}

rules/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function refactor(Node $node): ?Node
140140
if ($desiredTagValueNode->value instanceof GenericTagValueNode) {
141141
$originalAttributeValue = $desiredTagValueNode->value->value;
142142
} else {
143-
$originalAttributeValue = $desiredTagValueNode->value->identifierTypeNode->name;
143+
$originalAttributeValue = $desiredTagValueNode->value->getOriginalContent();
144144
}
145145

146146
$node->attrGroups[] = $this->createAttributeGroup(strtok($originalAttributeValue, " \t\n\r\0\x0B"));

0 commit comments

Comments
 (0)