diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index aa5d2be41eb..c0eff591899 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 = '6e936f73472d31e5d93da3b3a4fbe2c78b4fbf5a'; + public const PACKAGE_VERSION = '6f863d1552d270c2df41742ffcd87e2168d135b5'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-10-12 20:33:28'; + public const RELEASE_DATE = '2024-10-12 20:45:54'; /** * @var int */ diff --git a/src/PostRector/Rector/UnusedImportRemovingPostRector.php b/src/PostRector/Rector/UnusedImportRemovingPostRector.php index 59b31642dae..10c08859f86 100644 --- a/src/PostRector/Rector/UnusedImportRemovingPostRector.php +++ b/src/PostRector/Rector/UnusedImportRemovingPostRector.php @@ -41,7 +41,7 @@ public function enterNode(Node $node) : ?Node return null; } $hasChanged = \false; - $namespaceOriginalName = $node instanceof Namespace_ && $node->name instanceof Name ? $node->name : null; + $namespaceOriginalCase = $node instanceof Namespace_ && $node->name instanceof Name ? $node->name->toString() : null; $namesInOriginalCase = $this->resolveUsedPhpAndDocNames($node); $namesInLowerCase = \array_map(\Closure::fromCallable('strtolower'), $namesInOriginalCase); foreach ($node->stmts as $key => $stmt) { @@ -55,7 +55,7 @@ public function enterNode(Node $node) : ?Node } $isCaseSensitive = $stmt->type === Use_::TYPE_CONSTANT; $names = $isCaseSensitive ? $namesInOriginalCase : $namesInLowerCase; - $namespaceName = $namespaceOriginalName instanceof Name ? $isCaseSensitive ? $namespaceOriginalName->toString() : \strtolower($namespaceOriginalName->toString()) : null; + $namespaceName = $namespaceOriginalCase === null ? null : ($isCaseSensitive ? $namespaceOriginalCase : \strtolower($namespaceOriginalCase)); foreach ($stmt->uses as $useUseKey => $useUse) { if ($this->isUseImportUsed($useUse, $isCaseSensitive, $names, $namespaceName)) { continue;