Skip to content

Commit

Permalink
[Performance] Early skip func call name on ClassRenamer (#5837)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 20, 2024
1 parent 9ce6af8 commit 068799f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rules/Renaming/NodeManipulator/ClassRenamer.php
Expand Up @@ -114,14 +114,18 @@ private function shouldSkip(string $newName, FullyQualified $fullyQualified): bo
return $classReflection->isInterface();
}

return $fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === true;
return false;
}

/**
* @param array<string, string> $oldToNewClasses
*/
private function refactorName(FullyQualified $fullyQualified, array $oldToNewClasses): ?FullyQualified
{
if ($fullyQualified->getAttribute(AttributeKey::IS_FUNCCALL_NAME) === true) {
return null;
}

$stringName = $fullyQualified->toString();
$newName = $oldToNewClasses[$stringName] ?? null;

Expand Down

0 comments on commit 068799f

Please sign in to comment.