From b89547bfbe4104ac6fa88b5945910bcdab5ad6e4 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 16 Nov 2023 19:38:51 +0000 Subject: [PATCH] Updated Rector to commit 2d1b9ab461c35e326b2ad78bd2758c5c3a69c9cc https://github.com/rectorphp/rector-src/commit/2d1b9ab461c35e326b2ad78bd2758c5c3a69c9cc [Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector (#5256) --- packages/PostRector/Rector/UseAddingPostRector.php | 9 +++++++++ src/Application/VersionResolver.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/PostRector/Rector/UseAddingPostRector.php b/packages/PostRector/Rector/UseAddingPostRector.php index d1793af0bd3..2a822174e00 100644 --- a/packages/PostRector/Rector/UseAddingPostRector.php +++ b/packages/PostRector/Rector/UseAddingPostRector.php @@ -95,6 +95,15 @@ final class UseAddingPostRector extends \Rector\PostRector\Rector\AbstractPostRe $this->useImportsAdder->addImportsToNamespace($namespace, $useImportTypes, $constantUseImportTypes, $functionUseImportTypes); return $nodes; } + // just renamed no-namepaced class to namespaced class + $namespaces = \array_filter($nodes, static function (Stmt $stmt) : bool { + return $stmt instanceof Namespace_; + }); + if ($namespaces !== []) { + // then add, to prevent adding + removing false positive of same short use + $this->useImportsAdder->addImportsToNamespace(\current($namespaces), $useImportTypes, $constantUseImportTypes, $functionUseImportTypes); + return $nodes; + } // B. no namespace? add in the top $useImportTypes = $this->filterOutNonNamespacedNames($useImportTypes); // then add, to prevent adding + removing false positive of same short use diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 791536771b9..b51c174ea5b 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 = '0.18.9'; + public const PACKAGE_VERSION = '2d1b9ab461c35e326b2ad78bd2758c5c3a69c9cc'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-11-17 00:34:24'; + public const RELEASE_DATE = '2023-11-17 02:36:50'; /** * @var int */