Merge pull request #76 from RectorPHP/dynamic-ns-fixes

[Rector] fix NamespaceReplacerRector order
This commit is contained in:
Tomáš Votruba 2017-10-07 22:32:21 +02:00 committed by GitHub
commit 6ebd1a85aa
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,8 @@ final class NamespaceReplacerRector extends AbstractRector
*/
public function __construct(array $oldToNewNamespaces)
{
krsort($oldToNewNamespaces);
$this->oldToNewNamespaces = $oldToNewNamespaces;
}

View File

@ -1,5 +1,4 @@
rectors:
Rector\Rector\Dynamic\NamespaceReplacerRector:
# todo: add autosort to make complex first; allows reverse order
'OldNamespaceWith\OldSplitNamespace': 'NewNamespaceWith\NewSplitNamespace'
'OldNamespace': 'NewNamespace'
'OldNamespaceWith\OldSplitNamespace': 'NewNamespaceWith\NewSplitNamespace'