Updated Rector to commit 2d1b9ab461c35e326b2ad78bd2758c5c3a69c9cc

2d1b9ab461 [Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector (#5256)
This commit is contained in:
Tomas Votruba 2023-11-16 19:38:51 +00:00
parent 5aeafef0ed
commit b89547bfbe
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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
*/