From 6a9ca3dee817753fcfea20e6cd7a52671c95dc5a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 21 Aug 2018 17:47:23 +0200 Subject: [PATCH] [Namespace] Fix arguments of PseudoNamespaceToNamespaceRector --- config/level/phpunit/phpunit60.yml | 5 +++-- config/level/twig/underscore-to-namespace.yml | 2 +- src/Rector/Namespace_/PseudoNamespaceToNamespaceRector.php | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/level/phpunit/phpunit60.yml b/config/level/phpunit/phpunit60.yml index 9bc3adf6264..7fec24b1b79 100644 --- a/config/level/phpunit/phpunit60.yml +++ b/config/level/phpunit/phpunit60.yml @@ -4,10 +4,11 @@ services: # ref. https://github.com/sebastianbergmann/phpunit/compare/5.7.9...6.0.0 Rector\Rector\Namespace_\PseudoNamespaceToNamespaceRector: - $configuration: + $pseudoNamespacePrefixes: - 'PHPUnit_' + $excludedClasses: # exclude this class, since it has no namespaced replacement - - '!PHPUnit_Framework_MockObject_MockObject' + - 'PHPUnit_Framework_MockObject_MockObject' # handles 2nd and 3rd argument of setExpectedException Rector\PHPUnit\Rector\DelegateExceptionArgumentsRector: ~ diff --git a/config/level/twig/underscore-to-namespace.yml b/config/level/twig/underscore-to-namespace.yml index ffb247910c5..d1259cc5c51 100644 --- a/config/level/twig/underscore-to-namespace.yml +++ b/config/level/twig/underscore-to-namespace.yml @@ -155,5 +155,5 @@ services: 'Twig_Extensions_Node_Trans': 'Twig\Extensions\Node\TransNode' Rector\Rector\Namespace_\PseudoNamespaceToNamespaceRector: - $configuration: + $pseudoNamespacePrefixes: - 'Twig_' diff --git a/src/Rector/Namespace_/PseudoNamespaceToNamespaceRector.php b/src/Rector/Namespace_/PseudoNamespaceToNamespaceRector.php index 4d0b308b2a6..c9e3869b527 100644 --- a/src/Rector/Namespace_/PseudoNamespaceToNamespaceRector.php +++ b/src/Rector/Namespace_/PseudoNamespaceToNamespaceRector.php @@ -47,10 +47,10 @@ final class PseudoNamespaceToNamespaceRector extends AbstractRector * @param string[] $excludedClasses */ public function __construct( - array $pseudoNamespacePrefixes, - array $excludedClasses, NodeFactory $nodeFactory, - StatementGlue $statementGlue + StatementGlue $statementGlue, + array $pseudoNamespacePrefixes, + array $excludedClasses = [] ) { $this->nodeFactory = $nodeFactory; $this->statementGlue = $statementGlue;