Skip to content

Commit

Permalink
[Prefix] Fix Prefixed PHPUnit Ticket class (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik authored Aug 15, 2024
1 parent 2bacfc6 commit 455b0c7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use PhpParser\Node\Stmt\ClassMethod;
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
use PHPUnit\Framework\Attributes\Ticket;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
Expand All @@ -32,6 +31,11 @@
*/
final class TicketAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
{
/**
* @var string
*/
private const TICKET_CLASS = 'PHPUnit\Framework\Attributes\Ticket';

public function __construct(
private readonly PhpDocTagRemover $phpDocTagRemover,
private readonly DocBlockUpdater $docBlockUpdater,
Expand Down Expand Up @@ -123,7 +127,7 @@ public function refactor(Node $node): ?Node

private function createTicketAttribute(string $stringValue): Attribute
{
$fullyQualified = new FullyQualified(Ticket::class);
$fullyQualified = new FullyQualified(self::TICKET_CLASS);
$ticketString = new String_($stringValue);

$args = [new Arg($ticketString)];
Expand Down

0 comments on commit 455b0c7

Please sign in to comment.