diff --git a/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php b/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php index de05b91f6b..3630accd57 100644 --- a/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php +++ b/src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php @@ -22,6 +22,7 @@ use Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor; use Rector\Renaming\Collector\RenamedNameCollector; use Rector\StaticTypeMapper\StaticTypeMapper; +use Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType; use Rector\StaticTypeMapper\ValueObject\Type\ShortenedObjectType; final class ClassRenamePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor @@ -134,8 +135,8 @@ private function resolveNamespacedName( return $name; } - if ($staticType instanceof ShortenedObjectType) { - return $name; + if ($staticType instanceof ShortenedObjectType || $staticType instanceof AliasedObjectType) { + return $staticType->getFullyQualifiedName(); } $uses = $this->useImportsResolver->resolve();