[Namespace] Fix arguments of PseudoNamespaceToNamespaceRector

This commit is contained in:
Tomas Votruba 2018-08-21 17:47:23 +02:00
parent ac98817066
commit 6a9ca3dee8
3 changed files with 7 additions and 6 deletions

View File

@ -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: ~

View File

@ -155,5 +155,5 @@ services:
'Twig_Extensions_Node_Trans': 'Twig\Extensions\Node\TransNode'
Rector\Rector\Namespace_\PseudoNamespaceToNamespaceRector:
$configuration:
$pseudoNamespacePrefixes:
- 'Twig_'

View File

@ -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;