Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function resolve(Node $node, ?Scope $scope): ?string
}
}

if (is_string($namespaceName)) {
return $namespaceName;
}

return (string) $node->name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

final class DontRenameDifferentNamespacedFunction
{
public function run(): void
{
$addressParts = Psl\Str\split($addressLine, $houseNumber);
}
}

?>
-----
<?php

use function Psl\Str\split;

final class DontRenameDifferentNamespacedFunction
{
public function run(): void
{
$addressParts = split($addressLine, $houseNumber);
}
}
4 changes: 4 additions & 0 deletions tests/Issues/AutoImport/config/configured_rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Symfony\Symfony44\Rector\ClassMethod\ConsoleExecuteReturnIntRector;

Expand All @@ -22,4 +23,7 @@
new AnnotationToAttribute('Doctrine\ORM\Mapping\Entity'),
]);
$rectorConfig->rules([ConsoleExecuteReturnIntRector::class, RemoveUnusedPrivatePropertyRector::class]);
$rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [
'split' => 'explode',
]);
};
Loading