Skip to content

Commit

Permalink
Updated Rector to commit 2d1b9ab461c35e326b2ad78bd2758c5c3a69c9cc
Browse files Browse the repository at this point in the history
rectorphp/rector-src@2d1b9ab [Renaming] FQN-ize namespaced import no namespace -> namespaced name on RenameClassRector (#5256)
  • Loading branch information
TomasVotruba committed Nov 16, 2023
1 parent 5aeafef commit b89547b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions packages/PostRector/Rector/UseAddingPostRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ private function resolveNodesWithImportedUses(array $nodes, array $useImportType
$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
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit b89547b

Please sign in to comment.