From 9fde5b0ea87db502b93422d1ff6b5a6a9d954203 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 25 Nov 2023 10:51:46 +0000 Subject: [PATCH] Updated Rector to commit 8b7829f77f2393d41ff71a2e0f0504835e22bba2 https://github.com/rectorphp/rector-src/commit/8b7829f77f2393d41ff71a2e0f0504835e22bba2 [AutoImport] Apply @\ auto import on AnnotationToAttributeRector (#5286) --- packages/PhpAttribute/NodeFactory/AttributeNameFactory.php | 6 +++++- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/PhpAttribute/NodeFactory/AttributeNameFactory.php b/packages/PhpAttribute/NodeFactory/AttributeNameFactory.php index fd4fa9504fc..e87ae41aa1d 100644 --- a/packages/PhpAttribute/NodeFactory/AttributeNameFactory.php +++ b/packages/PhpAttribute/NodeFactory/AttributeNameFactory.php @@ -27,10 +27,14 @@ final class AttributeNameFactory */ public function create(AnnotationToAttributeInterface $annotationToAttribute, DoctrineAnnotationTagValueNode $doctrineAnnotationTagValueNode, array $uses) { - // A. attribute and class name are the same, so we re-use the short form to keep code compatible with previous one + // A. attribute and class name are the same, so we re-use the short form to keep code compatible with previous one, + // except start with \ if ($annotationToAttribute->getAttributeClass() === $annotationToAttribute->getTag()) { $attributeName = $doctrineAnnotationTagValueNode->identifierTypeNode->name; $attributeName = \ltrim($attributeName, '@'); + if (\strncmp($attributeName, '\\', \strlen('\\')) === 0) { + return new FullyQualified(\ltrim($attributeName, '\\')); + } return new Name($attributeName); } // B. different name diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 02f44a14920..f8f9fbfa27d 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '3f42ee98ffefc73677b93308fe53508bd260a574'; + public const PACKAGE_VERSION = '8b7829f77f2393d41ff71a2e0f0504835e22bba2'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-11-25 11:54:21'; + public const RELEASE_DATE = '2023-11-25 17:49:41'; /** * @var int */