Skip to content

Commit

Permalink
[Php55] Clean up FullyQualified assigned to FullyQualified on StringC…
Browse files Browse the repository at this point in the history
…lassNameToClassConstantRector (#4284)
  • Loading branch information
samsonasik committed Jun 19, 2023
1 parent 4b05faa commit d9f02ca
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -132,17 +132,16 @@ public function refactor(Node $node): Concat|ClassConstFetch|null|int
}

$fullyQualified = new FullyQualified($classLikeName);
$fullyQualifiedOrAliasName = new FullyQualified($fullyQualified);

if ($classLikeName !== $node->value) {
$preSlashCount = strlen($node->value) - strlen($classLikeName);
$preSlash = str_repeat('\\', $preSlashCount);
$string = new String_($preSlash);

return new Concat($string, new ClassConstFetch($fullyQualifiedOrAliasName, 'class'));
return new Concat($string, new ClassConstFetch($fullyQualified, 'class'));
}

return new ClassConstFetch($fullyQualifiedOrAliasName, 'class');
return new ClassConstFetch($fullyQualified, 'class');
}

/**
Expand Down

0 comments on commit d9f02ca

Please sign in to comment.