From 1fe23d12c8f754192224d2c469d12f01cd54d9bb Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 29 Apr 2019 07:32:50 +0200 Subject: [PATCH] merge getRectorClass() and getRectorConfiguration() --- .../ModalToGetSetRectorTest.php | 11 +-- ...eturnArrayClassMethodToYieldRectorTest.php | 11 +-- ...lassMethodToArrayClassMethodRectorTest.php | 11 +-- .../AliasToClassRectorTest.php | 11 +-- .../ObjectToScalarDocBlockRectorTest.php | 11 +-- .../ObjectToScalarRectorTest.php | 11 +-- .../MessageAsArrayRectorTest.php | 9 +-- .../MinutesToSecondsInCacheRectorTest.php | 11 +-- ...rListToControllerAnnotationsRectorTest.php | 11 +-- ...teControlToSymfonyControllerRectorTest.php | 11 +-- .../NetteFormToSymfonyFormRectorTest.php | 11 +-- ...RequestGetHeaderToHeadersGetRectorTest.php | 11 +-- ...tGetParameterToAttributesGetRectorTest.php | 11 +-- .../WrapTransParameterNameRectorTest.php | 9 +-- .../NodeAnalyzer/DocBlockManipulator.php | 1 - .../RenameConstantRectorTest.php | 11 +-- .../SwapFuncCallArgumentsRectorTest.php | 11 +-- .../PreferThisOrSelfMethodCallRectorTest.php | 11 +-- .../ReservedObjectRectorTest.php | 11 +-- ...nitStaticToKernelTestCaseGetRectorTest.php | 11 +-- .../StaticTypeToSetterInjectionRectorTest.php | 11 +-- .../TemplateAnnotationVersion3RectorTest.php | 9 +-- .../TemplateAnnotationVersion5RectorTest.php | 9 +-- ...eCreateMethodWithoutReviewerRectorTest.php | 11 +-- .../AddFlashRector/AddFlashRectorTest.php | 9 +-- .../RedirectToRouteRectorTest.php | 9 +-- .../FormIsValidRectorTest.php | 9 +-- .../FormTypeGetParentRectorTest.php | 11 +-- .../OptionNameRector/OptionNameRectorTest.php | 11 +-- .../StringFormTypeToClassRectorTest.php | 9 +-- ...nerGetToConstructorInjectionRectorTest.php | 11 +-- ...ameterToConstructorInjectionRectorTest.php | 9 +-- .../GetToConstructorInjectionRectorTest.php | 11 +-- ...FormTypeInstanceToClassConstRectorTest.php | 11 +-- .../ReadOnlyOptionToAttributeRectorTest.php | 9 +-- ...implifyWebTestCaseAssertionsRectorTest.php | 11 +-- .../RootNodeTreeBuilderRectorTest.php | 9 +-- ...StringToArrayArgumentProcessRectorTest.php | 11 +-- .../ProcessBuilderGetProcessRectorTest.php | 9 +-- .../ProcessBuilderInstanceRectorTest.php | 9 +-- ...VarDumperTestTraitMethodArgsRectorTest.php | 9 +-- .../SimpleFunctionAndFilterRectorTest.php | 11 +-- .../PHPUnit/AbstractRectorTestCase.php | 11 +-- .../RenameAnnotationRectorTest.php | 11 +-- ...InjectToConstructorInjectionRectorTest.php | 9 +-- .../NewObjectToFactoryCreateRectorTest.php | 11 +-- .../ArgumentAdderRectorTest.php | 11 +-- ...ArgumentDefaultValueReplacerRectorTest.php | 67 +++++++++---------- .../ArgumentRemoverRectorTest.php | 36 +++++----- .../PropertyAssignToMethodCallRectorTest.php | 11 +-- .../RemoveTraitRectorTest.php | 11 +-- .../AddReturnTypeDeclarationRectorTest.php | 11 +-- .../WrapReturnRector/WrapReturnRectorTest.php | 11 +-- .../ParentClassToTraitsRectorTest.php | 11 +-- .../RenameClassRectorTest.php | 11 +-- .../RenameClassConstantRectorTest.php | 11 +-- ...meClassConstantsUseToStringsRectorTest.php | 11 +-- .../FunctionToNewRectorTest.php | 11 +-- .../FunctionToMethodCallRectorTest.php | 11 +-- .../FunctionToStaticCallRectorTest.php | 11 +-- .../RenameFunctionRectorTest.php | 11 +-- .../MergeInterfacesRectorTest.php | 11 +-- .../RemoveInterfacesRectorTest.php | 11 +-- .../GetAndSetToMethodCallRectorTest.php | 11 +-- .../ToStringToMethodCallRectorTest.php | 11 +-- .../UnsetAndIssetToMethodCallRectorTest.php | 11 +-- .../FluentReplaceRectorTest.php | 11 +-- .../NormalToFluentRectorTest.php | 11 +-- ...otherMethodCallWithArgumentsRectorTest.php | 11 +-- .../RenameMethodCallRectorTest.php | 11 +-- .../RenameMethodRectorTest.php | 11 +-- .../RenameStaticMethodRectorTest.php | 11 +-- .../PseudoNamespaceToNamespaceRectorTest.php | 11 +-- .../RenameNamespaceRectorTest.php | 11 +-- .../NewToStaticCallRectorTest.php | 11 +-- .../PropertyToMethodRectorTest.php | 11 +-- .../RenamePropertyRectorTest.php | 11 +-- .../StaticCallToFunctionRectorTest.php | 11 +-- .../StringToClassConstantRectorTest.php | 11 +-- .../ParentTypehintedArgumentRectorTest.php | 11 +-- .../ChangeConstantVisibilityRectorTest.php | 11 +-- .../ChangeMethodVisibilityRectorTest.php | 11 +-- .../ChangePropertyVisibilityRectorTest.php | 11 +-- 83 files changed, 271 insertions(+), 683 deletions(-) diff --git a/packages/CakePHP/tests/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php b/packages/CakePHP/tests/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php index fb8a068423c..b53e7d90f31 100644 --- a/packages/CakePHP/tests/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php +++ b/packages/CakePHP/tests/Rector/MethodCall/ModalToGetSetRector/ModalToGetSetRectorTest.php @@ -17,17 +17,12 @@ final class ModalToGetSetRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ModalToGetSetRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ModalToGetSetRector::class => [ '$methodNamesByTypes' => [ SomeModelType::class => [ 'config' => [ @@ -44,6 +39,6 @@ final class ModalToGetSetRectorTest extends AbstractRectorTestCase 'method' => null, ], ], - ]; + ]]; } } diff --git a/packages/CodingStyle/tests/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector/ReturnArrayClassMethodToYieldRectorTest.php b/packages/CodingStyle/tests/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector/ReturnArrayClassMethodToYieldRectorTest.php index 4a9d86ba18c..10c538ae165 100644 --- a/packages/CodingStyle/tests/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector/ReturnArrayClassMethodToYieldRectorTest.php +++ b/packages/CodingStyle/tests/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector/ReturnArrayClassMethodToYieldRectorTest.php @@ -21,21 +21,16 @@ final class ReturnArrayClassMethodToYieldRectorTest extends AbstractRectorTestCa ]); } - protected function getRectorClass(): string - { - return ReturnArrayClassMethodToYieldRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ReturnArrayClassMethodToYieldRector::class => [ '$methodsByType' => [ EventSubscriberInterface::class => ['getSubscribedEvents'], ParentTestCase::class => ['#(provide|dataProvider)*#'], ], - ]; + ]]; } } diff --git a/packages/CodingStyle/tests/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector/YieldClassMethodToArrayClassMethodRectorTest.php b/packages/CodingStyle/tests/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector/YieldClassMethodToArrayClassMethodRectorTest.php index 72a8622f770..b82d444dd8d 100644 --- a/packages/CodingStyle/tests/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector/YieldClassMethodToArrayClassMethodRectorTest.php +++ b/packages/CodingStyle/tests/Rector/ClassMethod/YieldClassMethodToArrayClassMethodRector/YieldClassMethodToArrayClassMethodRectorTest.php @@ -13,20 +13,15 @@ final class YieldClassMethodToArrayClassMethodRectorTest extends AbstractRectorT $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/type_declaration.php.inc']); } - protected function getRectorClass(): string - { - return YieldClassMethodToArrayClassMethodRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [YieldClassMethodToArrayClassMethodRector::class => [ '$methodsByType' => [ EventSubscriberInterface::class => ['getSubscribedEvents'], ], - ]; + ]]; } } diff --git a/packages/Doctrine/tests/Rector/AliasToClassRector/AliasToClassRectorTest.php b/packages/Doctrine/tests/Rector/AliasToClassRector/AliasToClassRectorTest.php index 32a9d774d9f..6e0f95b4781 100644 --- a/packages/Doctrine/tests/Rector/AliasToClassRector/AliasToClassRectorTest.php +++ b/packages/Doctrine/tests/Rector/AliasToClassRector/AliasToClassRectorTest.php @@ -13,21 +13,16 @@ final class AliasToClassRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return AliasToClassRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [AliasToClassRector::class => [ '$aliasesToNamespaces' => [ 'App' => 'App\Entity', ], '$entityManagerClass' => DoctrineEntityManager::class, - ]; + ]]; } } diff --git a/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarDocBlockRector/ObjectToScalarDocBlockRectorTest.php b/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarDocBlockRector/ObjectToScalarDocBlockRectorTest.php index 127ee5c6d9b..94a93fcc4bc 100644 --- a/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarDocBlockRector/ObjectToScalarDocBlockRectorTest.php +++ b/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarDocBlockRector/ObjectToScalarDocBlockRectorTest.php @@ -17,20 +17,15 @@ final class ObjectToScalarDocBlockRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ObjectToScalarDocBlockRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ObjectToScalarDocBlockRector::class => [ '$valueObjectsToSimpleTypes' => [ SomeValueObject::class => 'string', ], - ]; + ]]; } } diff --git a/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarRector/ObjectToScalarRectorTest.php b/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarRector/ObjectToScalarRectorTest.php index f63494f2905..9a484c4eb86 100644 --- a/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarRector/ObjectToScalarRectorTest.php +++ b/packages/DomainDrivenDesign/tests/Rector/ObjectToScalarRector/ObjectToScalarRectorTest.php @@ -18,20 +18,15 @@ final class ObjectToScalarRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ObjectToScalarRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ObjectToScalarRector::class => [ '$valueObjectsToSimpleTypes' => [ SomeValueObject::class => 'string', ], - ]; + ]]; } } diff --git a/packages/Guzzle/tests/Rector/MethodCall/MessageAsArrayRector/MessageAsArrayRectorTest.php b/packages/Guzzle/tests/Rector/MethodCall/MessageAsArrayRector/MessageAsArrayRectorTest.php index 0b8ab8bd707..5be6c74ec97 100644 --- a/packages/Guzzle/tests/Rector/MethodCall/MessageAsArrayRector/MessageAsArrayRectorTest.php +++ b/packages/Guzzle/tests/Rector/MethodCall/MessageAsArrayRector/MessageAsArrayRectorTest.php @@ -13,16 +13,11 @@ final class MessageAsArrayRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return MessageAsArrayRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$messageType' => MessageType::class]; + return [MessageAsArrayRector::class => ['$messageType' => MessageType::class]]; } } diff --git a/packages/Laravel/tests/Rector/StaticCall/MinutesToSecondsInCacheRector/MinutesToSecondsInCacheRectorTest.php b/packages/Laravel/tests/Rector/StaticCall/MinutesToSecondsInCacheRector/MinutesToSecondsInCacheRectorTest.php index cd670238aef..27857951d9a 100644 --- a/packages/Laravel/tests/Rector/StaticCall/MinutesToSecondsInCacheRector/MinutesToSecondsInCacheRectorTest.php +++ b/packages/Laravel/tests/Rector/StaticCall/MinutesToSecondsInCacheRector/MinutesToSecondsInCacheRectorTest.php @@ -13,18 +13,13 @@ final class MinutesToSecondsInCacheRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/skip_call.php.inc']); } - protected function getRectorClass(): string - { - return MinutesToSecondsInCacheRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [MinutesToSecondsInCacheRector::class => [ '$storeClass' => LaravelStoreInterface::class, // just for test case - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/ClassMethod/RouterListToControllerAnnotationsRetor/RouterListToControllerAnnotationsRectorTest.php b/packages/NetteToSymfony/tests/Rector/ClassMethod/RouterListToControllerAnnotationsRetor/RouterListToControllerAnnotationsRectorTest.php index a7f929787b1..d44a452ca44 100644 --- a/packages/NetteToSymfony/tests/Rector/ClassMethod/RouterListToControllerAnnotationsRetor/RouterListToControllerAnnotationsRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/ClassMethod/RouterListToControllerAnnotationsRetor/RouterListToControllerAnnotationsRectorTest.php @@ -21,19 +21,14 @@ final class RouterListToControllerAnnotationsRectorTest extends AbstractRectorTe ]); } - protected function getRectorClass(): string - { - return RouterListToControllerAnnotationsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RouterListToControllerAnnotationsRector::class => [ '$routeListClass' => RouteList::class, '$routerClass' => Route::class, - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/Class_/NetteControlToSymfonyControllerRector/NetteControlToSymfonyControllerRectorTest.php b/packages/NetteToSymfony/tests/Rector/Class_/NetteControlToSymfonyControllerRector/NetteControlToSymfonyControllerRectorTest.php index e5799ba4d9c..81629059296 100644 --- a/packages/NetteToSymfony/tests/Rector/Class_/NetteControlToSymfonyControllerRector/NetteControlToSymfonyControllerRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/Class_/NetteControlToSymfonyControllerRector/NetteControlToSymfonyControllerRectorTest.php @@ -13,18 +13,13 @@ final class NetteControlToSymfonyControllerRectorTest extends AbstractRectorTest $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return NetteControlToSymfonyControllerRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [NetteControlToSymfonyControllerRector::class => [ '$netteControlClass' => NetteControl::class, - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/Class_/NetteFormToSymfonyFormRector/NetteFormToSymfonyFormRectorTest.php b/packages/NetteToSymfony/tests/Rector/Class_/NetteFormToSymfonyFormRector/NetteFormToSymfonyFormRectorTest.php index d536dac7049..2d8a78b45b9 100644 --- a/packages/NetteToSymfony/tests/Rector/Class_/NetteFormToSymfonyFormRector/NetteFormToSymfonyFormRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/Class_/NetteFormToSymfonyFormRector/NetteFormToSymfonyFormRectorTest.php @@ -13,18 +13,13 @@ final class NetteFormToSymfonyFormRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return NetteFormToSymfonyFormRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [NetteFormToSymfonyFormRector::class => [ '$presenterClass' => NettePresenter::class, - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/MethodCall/FromHttpRequestGetHeaderToHeadersGetRector/FromHttpRequestGetHeaderToHeadersGetRectorTest.php b/packages/NetteToSymfony/tests/Rector/MethodCall/FromHttpRequestGetHeaderToHeadersGetRector/FromHttpRequestGetHeaderToHeadersGetRectorTest.php index 136ebf8e8e6..c2e829aa417 100644 --- a/packages/NetteToSymfony/tests/Rector/MethodCall/FromHttpRequestGetHeaderToHeadersGetRector/FromHttpRequestGetHeaderToHeadersGetRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/MethodCall/FromHttpRequestGetHeaderToHeadersGetRector/FromHttpRequestGetHeaderToHeadersGetRectorTest.php @@ -13,18 +13,13 @@ final class FromHttpRequestGetHeaderToHeadersGetRectorTest extends AbstractRecto $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/missing_argument.php.inc']); } - protected function getRectorClass(): string - { - return FromHttpRequestGetHeaderToHeadersGetRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FromHttpRequestGetHeaderToHeadersGetRector::class => [ '$netteHttpRequestClass' => NetteHttpRequest::class, - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/MethodCall/FromRequestGetParameterToAttributesGetRector/FromRequestGetParameterToAttributesGetRectorTest.php b/packages/NetteToSymfony/tests/Rector/MethodCall/FromRequestGetParameterToAttributesGetRector/FromRequestGetParameterToAttributesGetRectorTest.php index 93e43b4c083..74389642b24 100644 --- a/packages/NetteToSymfony/tests/Rector/MethodCall/FromRequestGetParameterToAttributesGetRector/FromRequestGetParameterToAttributesGetRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/MethodCall/FromRequestGetParameterToAttributesGetRector/FromRequestGetParameterToAttributesGetRectorTest.php @@ -13,18 +13,13 @@ final class FromRequestGetParameterToAttributesGetRectorTest extends AbstractRec $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return FromRequestGetParameterToAttributesGetRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FromRequestGetParameterToAttributesGetRector::class => [ '$netteRequestClass' => NetteRequest::class, - ]; + ]]; } } diff --git a/packages/NetteToSymfony/tests/Rector/MethodCall/WrapTransParameterNameRector/WrapTransParameterNameRectorTest.php b/packages/NetteToSymfony/tests/Rector/MethodCall/WrapTransParameterNameRector/WrapTransParameterNameRectorTest.php index 253a04ff004..6a1d4970dcc 100644 --- a/packages/NetteToSymfony/tests/Rector/MethodCall/WrapTransParameterNameRector/WrapTransParameterNameRectorTest.php +++ b/packages/NetteToSymfony/tests/Rector/MethodCall/WrapTransParameterNameRector/WrapTransParameterNameRectorTest.php @@ -13,16 +13,11 @@ final class WrapTransParameterNameRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return WrapTransParameterNameRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$translatorClass' => SomeTranslator::class]; + return [WrapTransParameterNameRector::class => ['$translatorClass' => SomeTranslator::class]]; } } diff --git a/packages/NodeTypeResolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php b/packages/NodeTypeResolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php index fb45e085db8..fe10a745510 100644 --- a/packages/NodeTypeResolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php +++ b/packages/NodeTypeResolver/src/PhpDoc/NodeAnalyzer/DocBlockManipulator.php @@ -259,7 +259,6 @@ final class DocBlockManipulator } } - public function addReturnTag(Node $node, string $type): void { // there might be no phpdoc at all diff --git a/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/RenameConstantRectorTest.php b/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/RenameConstantRectorTest.php index c9a0a78097f..e483f4db4bc 100644 --- a/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/RenameConstantRectorTest.php +++ b/packages/Php/tests/Rector/ConstFetch/RenameConstantRector/RenameConstantRectorTest.php @@ -12,21 +12,16 @@ final class RenameConstantRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/spaghetti.php.inc']); } - protected function getRectorClass(): string - { - return RenameConstantRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameConstantRector::class => [ '$oldToNewConstants' => [ 'MYSQL_ASSOC' => 'MYSQLI_ASSOC', 'OLD_CONSTANT' => 'NEW_CONSTANT', ], - ]; + ]]; } } diff --git a/packages/Php/tests/Rector/FuncCall/SwapFuncCallArgumentsRector/SwapFuncCallArgumentsRectorTest.php b/packages/Php/tests/Rector/FuncCall/SwapFuncCallArgumentsRector/SwapFuncCallArgumentsRectorTest.php index 1ea9614cfaf..2dfd9e9deec 100644 --- a/packages/Php/tests/Rector/FuncCall/SwapFuncCallArgumentsRector/SwapFuncCallArgumentsRectorTest.php +++ b/packages/Php/tests/Rector/FuncCall/SwapFuncCallArgumentsRector/SwapFuncCallArgumentsRectorTest.php @@ -12,20 +12,15 @@ final class SwapFuncCallArgumentsRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return SwapFuncCallArgumentsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [SwapFuncCallArgumentsRector::class => [ '$newArgumentPositionsByFunctionName' => [ 'some_function' => [1, 0], ], - ]; + ]]; } } diff --git a/packages/Php/tests/Rector/MethodCall/PreferThisOrSelfMethodCallRector/PreferThisOrSelfMethodCallRectorTest.php b/packages/Php/tests/Rector/MethodCall/PreferThisOrSelfMethodCallRector/PreferThisOrSelfMethodCallRectorTest.php index 78b7d7ae8f2..0a3ea538a6b 100644 --- a/packages/Php/tests/Rector/MethodCall/PreferThisOrSelfMethodCallRector/PreferThisOrSelfMethodCallRectorTest.php +++ b/packages/Php/tests/Rector/MethodCall/PreferThisOrSelfMethodCallRector/PreferThisOrSelfMethodCallRectorTest.php @@ -14,21 +14,16 @@ final class PreferThisOrSelfMethodCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/to_self.php.inc', __DIR__ . '/Fixture/to_this.php.inc']); } - protected function getRectorClass(): string - { - return PreferThisOrSelfMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [PreferThisOrSelfMethodCallRector::class => [ '$typeToPreference' => [ AbstractTestCase::class => 'self', BeLocalClass::class => 'this', ], - ]; + ]]; } } diff --git a/packages/Php/tests/Rector/Name/ReservedObjectRector/ReservedObjectRectorTest.php b/packages/Php/tests/Rector/Name/ReservedObjectRector/ReservedObjectRectorTest.php index d8f376de59b..08eb91a0285 100644 --- a/packages/Php/tests/Rector/Name/ReservedObjectRector/ReservedObjectRectorTest.php +++ b/packages/Php/tests/Rector/Name/ReservedObjectRector/ReservedObjectRectorTest.php @@ -12,20 +12,15 @@ final class ReservedObjectRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/ReservedObject.php']); } - protected function getRectorClass(): string - { - return ReservedObjectRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ReservedObjectRector::class => [ '$reservedKeywordsToReplacements' => [ 'ReservedObject' => 'SmartObject', ], - ]; + ]]; } } diff --git a/packages/RemovingStatic/tests/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector/PHPUnitStaticToKernelTestCaseGetRectorTest.php b/packages/RemovingStatic/tests/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector/PHPUnitStaticToKernelTestCaseGetRectorTest.php index df1526c7035..937c8996711 100644 --- a/packages/RemovingStatic/tests/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector/PHPUnitStaticToKernelTestCaseGetRectorTest.php +++ b/packages/RemovingStatic/tests/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector/PHPUnitStaticToKernelTestCaseGetRectorTest.php @@ -19,18 +19,13 @@ final class PHPUnitStaticToKernelTestCaseGetRectorTest extends AbstractRectorTes ]); } - protected function getRectorClass(): string - { - return PHPUnitStaticToKernelTestCaseGetRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [PHPUnitStaticToKernelTestCaseGetRector::class => [ '$staticClassTypes' => [ClassWithStaticMethods::class], - ]; + ]]; } } diff --git a/packages/RemovingStatic/tests/Rector/Class_/StaticTypeToSetterInjectionRector/StaticTypeToSetterInjectionRectorTest.php b/packages/RemovingStatic/tests/Rector/Class_/StaticTypeToSetterInjectionRector/StaticTypeToSetterInjectionRectorTest.php index 4ad5ead5a88..a127b44700d 100644 --- a/packages/RemovingStatic/tests/Rector/Class_/StaticTypeToSetterInjectionRector/StaticTypeToSetterInjectionRectorTest.php +++ b/packages/RemovingStatic/tests/Rector/Class_/StaticTypeToSetterInjectionRector/StaticTypeToSetterInjectionRectorTest.php @@ -19,22 +19,17 @@ final class StaticTypeToSetterInjectionRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return StaticTypeToSetterInjectionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [StaticTypeToSetterInjectionRector::class => [ '$staticTypes' => [ GenericEntityFactory::class, // with adding a parent interface to the class 'ParentSetterEnforcingInterface' => GenericEntityFactoryWithInterface::class, ], - ]; + ]]; } } diff --git a/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion3RectorTest.php b/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion3RectorTest.php index d842b00b5a3..0e01cb466fd 100644 --- a/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion3RectorTest.php +++ b/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion3RectorTest.php @@ -17,16 +17,11 @@ final class TemplateAnnotationVersion3RectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return TemplateAnnotationRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$version' => 3]; + return [TemplateAnnotationRector::class => ['$version' => 3]]; } } diff --git a/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion5RectorTest.php b/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion5RectorTest.php index 689aad1700f..793236877eb 100644 --- a/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion5RectorTest.php +++ b/packages/Sensio/tests/Rector/FrameworkExtraBundle/TemplateAnnotationRector/TemplateAnnotationVersion5RectorTest.php @@ -17,16 +17,11 @@ final class TemplateAnnotationVersion5RectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return TemplateAnnotationRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$version' => 5]; + return [TemplateAnnotationRector::class => ['$version' => 5]]; } } diff --git a/packages/Sylius/tests/Rector/Review/ReplaceCreateMethodWithoutReviewerRectorTest.php b/packages/Sylius/tests/Rector/Review/ReplaceCreateMethodWithoutReviewerRectorTest.php index b94d0cbf23b..c5877536c63 100644 --- a/packages/Sylius/tests/Rector/Review/ReplaceCreateMethodWithoutReviewerRectorTest.php +++ b/packages/Sylius/tests/Rector/Review/ReplaceCreateMethodWithoutReviewerRectorTest.php @@ -13,18 +13,13 @@ final class ReplaceCreateMethodWithoutReviewerRectorTest extends AbstractRectorT $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - public function getRectorClass(): string - { - return ReplaceCreateMethodWithoutReviewerRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ReplaceCreateMethodWithoutReviewerRector::class => [ '$reviewFactoryInterface' => ReviewFactoryInterface::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/Controller/AddFlashRector/AddFlashRectorTest.php b/packages/Symfony/tests/Rector/Controller/AddFlashRector/AddFlashRectorTest.php index 7d67b60b575..5d25bbd9778 100644 --- a/packages/Symfony/tests/Rector/Controller/AddFlashRector/AddFlashRectorTest.php +++ b/packages/Symfony/tests/Rector/Controller/AddFlashRector/AddFlashRectorTest.php @@ -13,16 +13,11 @@ final class AddFlashRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return AddFlashRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$controllerClass' => SymfonyController::class]; + return [AddFlashRector::class => ['$controllerClass' => SymfonyController::class]]; } } diff --git a/packages/Symfony/tests/Rector/Controller/RedirectToRouteRector/RedirectToRouteRectorTest.php b/packages/Symfony/tests/Rector/Controller/RedirectToRouteRector/RedirectToRouteRectorTest.php index 709586b9010..328c903528f 100644 --- a/packages/Symfony/tests/Rector/Controller/RedirectToRouteRector/RedirectToRouteRectorTest.php +++ b/packages/Symfony/tests/Rector/Controller/RedirectToRouteRector/RedirectToRouteRectorTest.php @@ -17,16 +17,11 @@ final class RedirectToRouteRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RedirectToRouteRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$controllerClass' => SymfonyController::class]; + return [RedirectToRouteRector::class => ['$controllerClass' => SymfonyController::class]]; } } diff --git a/packages/Symfony/tests/Rector/Form/FormIsValidRector/FormIsValidRectorTest.php b/packages/Symfony/tests/Rector/Form/FormIsValidRector/FormIsValidRectorTest.php index 0a10379e879..b8df75f01df 100644 --- a/packages/Symfony/tests/Rector/Form/FormIsValidRector/FormIsValidRectorTest.php +++ b/packages/Symfony/tests/Rector/Form/FormIsValidRector/FormIsValidRectorTest.php @@ -13,16 +13,11 @@ final class FormIsValidRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return FormIsValidRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$formClass' => Form::class]; + return [FormIsValidRector::class => ['$formClass' => Form::class]]; } } diff --git a/packages/Symfony/tests/Rector/Form/FormTypeGetParentRector/FormTypeGetParentRectorTest.php b/packages/Symfony/tests/Rector/Form/FormTypeGetParentRector/FormTypeGetParentRectorTest.php index 93111a7d6c0..c450045b2d2 100644 --- a/packages/Symfony/tests/Rector/Form/FormTypeGetParentRector/FormTypeGetParentRectorTest.php +++ b/packages/Symfony/tests/Rector/Form/FormTypeGetParentRector/FormTypeGetParentRectorTest.php @@ -14,19 +14,14 @@ final class FormTypeGetParentRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return FormTypeGetParentRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FormTypeGetParentRector::class => [ '$abstractTypeClass' => AbstractType::class, '$abstractTypeExtensionClass' => AbstractTypeExtension::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/Form/OptionNameRector/OptionNameRectorTest.php b/packages/Symfony/tests/Rector/Form/OptionNameRector/OptionNameRectorTest.php index cd334f33dbb..cf4f62c4fae 100644 --- a/packages/Symfony/tests/Rector/Form/OptionNameRector/OptionNameRectorTest.php +++ b/packages/Symfony/tests/Rector/Form/OptionNameRector/OptionNameRectorTest.php @@ -13,18 +13,13 @@ final class OptionNameRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return OptionNameRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [OptionNameRector::class => [ '$formBuilderType' => FormBuilder::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/Form/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php b/packages/Symfony/tests/Rector/Form/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php index 7558769e954..4eb9536bc6f 100644 --- a/packages/Symfony/tests/Rector/Form/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php +++ b/packages/Symfony/tests/Rector/Form/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php @@ -13,16 +13,11 @@ final class StringFormTypeToClassRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return StringFormTypeToClassRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$formBuilderClass' => FormBuilder::class]; + return [StringFormTypeToClassRector::class => ['$formBuilderClass' => FormBuilder::class]]; } } diff --git a/packages/Symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/ContainerGetToConstructorInjectionRectorTest.php b/packages/Symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/ContainerGetToConstructorInjectionRectorTest.php index deb3f199b90..314df0c967b 100644 --- a/packages/Symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/ContainerGetToConstructorInjectionRectorTest.php +++ b/packages/Symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/ContainerGetToConstructorInjectionRectorTest.php @@ -23,20 +23,15 @@ final class ContainerGetToConstructorInjectionRectorTest extends AbstractRectorT $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return ContainerGetToConstructorInjectionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ContainerGetToConstructorInjectionRector::class => [ '$containerAwareParentTypes' => [ 'Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass', ], - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector/GetParameterToConstructorInjectionRectorTest.php b/packages/Symfony/tests/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector/GetParameterToConstructorInjectionRectorTest.php index 914c9c90e00..cb288f9bb57 100644 --- a/packages/Symfony/tests/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector/GetParameterToConstructorInjectionRectorTest.php +++ b/packages/Symfony/tests/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector/GetParameterToConstructorInjectionRectorTest.php @@ -13,16 +13,11 @@ final class GetParameterToConstructorInjectionRectorTest extends AbstractRectorT $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return GetParameterToConstructorInjectionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$controllerClass' => SymfonyController::class]; + return [GetParameterToConstructorInjectionRector::class => ['$controllerClass' => SymfonyController::class]]; } } diff --git a/packages/Symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php b/packages/Symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php index 1d0953479d1..7bc4bc16b3e 100644 --- a/packages/Symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php +++ b/packages/Symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php @@ -30,18 +30,13 @@ final class GetToConstructorInjectionRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return GetToConstructorInjectionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [GetToConstructorInjectionRector::class => [ '$getMethodAwareTypes' => [SymfonyController::class, GetTrait::class], - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php b/packages/Symfony/tests/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php index 402f200df40..4c5b66ab722 100644 --- a/packages/Symfony/tests/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php +++ b/packages/Symfony/tests/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php @@ -19,20 +19,15 @@ final class FormTypeInstanceToClassConstRectorTest extends AbstractRectorTestCas ]); } - protected function getRectorClass(): string - { - return FormTypeInstanceToClassConstRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FormTypeInstanceToClassConstRector::class => [ '$controllerClass' => ControllerClass::class, '$formBuilderType' => FormBuilder::class, '$formType' => FormType::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php b/packages/Symfony/tests/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php index 4f40785461d..7ecf079b375 100644 --- a/packages/Symfony/tests/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php +++ b/packages/Symfony/tests/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php @@ -13,16 +13,11 @@ final class ReadOnlyOptionToAttributeRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return ReadOnlyOptionToAttributeRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$formBuilderType' => FormBuilder::class]; + return [ReadOnlyOptionToAttributeRector::class => ['$formBuilderType' => FormBuilder::class]]; } } diff --git a/packages/Symfony/tests/Rector/MethodCall/SimplifyWebTestCaseAssertionsRector/SimplifyWebTestCaseAssertionsRectorTest.php b/packages/Symfony/tests/Rector/MethodCall/SimplifyWebTestCaseAssertionsRector/SimplifyWebTestCaseAssertionsRectorTest.php index fd5741dafc5..0ff9c78bed8 100644 --- a/packages/Symfony/tests/Rector/MethodCall/SimplifyWebTestCaseAssertionsRector/SimplifyWebTestCaseAssertionsRectorTest.php +++ b/packages/Symfony/tests/Rector/MethodCall/SimplifyWebTestCaseAssertionsRector/SimplifyWebTestCaseAssertionsRectorTest.php @@ -16,18 +16,13 @@ final class SimplifyWebTestCaseAssertionsRectorTest extends AbstractRectorTestCa ]); } - protected function getRectorClass(): string - { - return SimplifyWebTestCaseAssertionsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [SimplifyWebTestCaseAssertionsRector::class => [ '$webTestCaseClass' => FixtureWebTestCase::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/New_/RootNodeTreeBuilderRector/RootNodeTreeBuilderRectorTest.php b/packages/Symfony/tests/Rector/New_/RootNodeTreeBuilderRector/RootNodeTreeBuilderRectorTest.php index 2ed5a329af0..7038a3e904d 100644 --- a/packages/Symfony/tests/Rector/New_/RootNodeTreeBuilderRector/RootNodeTreeBuilderRectorTest.php +++ b/packages/Symfony/tests/Rector/New_/RootNodeTreeBuilderRector/RootNodeTreeBuilderRectorTest.php @@ -13,16 +13,11 @@ final class RootNodeTreeBuilderRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return RootNodeTreeBuilderRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$treeBuilderClass' => TreeBuilder::class]; + return [RootNodeTreeBuilderRector::class => ['$treeBuilderClass' => TreeBuilder::class]]; } } diff --git a/packages/Symfony/tests/Rector/New_/StringToArrayArgumentProcessRector/StringToArrayArgumentProcessRectorTest.php b/packages/Symfony/tests/Rector/New_/StringToArrayArgumentProcessRector/StringToArrayArgumentProcessRectorTest.php index 3a34ac02e1a..0e0b5c7bbd6 100644 --- a/packages/Symfony/tests/Rector/New_/StringToArrayArgumentProcessRector/StringToArrayArgumentProcessRectorTest.php +++ b/packages/Symfony/tests/Rector/New_/StringToArrayArgumentProcessRector/StringToArrayArgumentProcessRectorTest.php @@ -20,19 +20,14 @@ final class StringToArrayArgumentProcessRectorTest extends AbstractRectorTestCas ]); } - protected function getRectorClass(): string - { - return StringToArrayArgumentProcessRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [StringToArrayArgumentProcessRector::class => [ '$processClass' => Process::class, '$processHelperClass' => ProcessHelper::class, - ]; + ]]; } } diff --git a/packages/Symfony/tests/Rector/Process/ProcessBuilderGetProcessRector/ProcessBuilderGetProcessRectorTest.php b/packages/Symfony/tests/Rector/Process/ProcessBuilderGetProcessRector/ProcessBuilderGetProcessRectorTest.php index 47dcd290d34..f6738d92754 100644 --- a/packages/Symfony/tests/Rector/Process/ProcessBuilderGetProcessRector/ProcessBuilderGetProcessRectorTest.php +++ b/packages/Symfony/tests/Rector/Process/ProcessBuilderGetProcessRector/ProcessBuilderGetProcessRectorTest.php @@ -13,16 +13,11 @@ final class ProcessBuilderGetProcessRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return ProcessBuilderGetProcessRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$processBuilderClass' => ProcessBuilder::class]; + return [ProcessBuilderGetProcessRector::class => ['$processBuilderClass' => ProcessBuilder::class]]; } } diff --git a/packages/Symfony/tests/Rector/Process/ProcessBuilderInstanceRector/ProcessBuilderInstanceRectorTest.php b/packages/Symfony/tests/Rector/Process/ProcessBuilderInstanceRector/ProcessBuilderInstanceRectorTest.php index fc4a6c9618e..5d8a71067c4 100644 --- a/packages/Symfony/tests/Rector/Process/ProcessBuilderInstanceRector/ProcessBuilderInstanceRectorTest.php +++ b/packages/Symfony/tests/Rector/Process/ProcessBuilderInstanceRector/ProcessBuilderInstanceRectorTest.php @@ -13,16 +13,11 @@ final class ProcessBuilderInstanceRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return ProcessBuilderInstanceRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$processBuilderClass' => ProcessBuilder::class]; + return [ProcessBuilderInstanceRector::class => ['$processBuilderClass' => ProcessBuilder::class]]; } } diff --git a/packages/Symfony/tests/Rector/VarDumper/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php b/packages/Symfony/tests/Rector/VarDumper/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php index 856992bcf2a..c354077e2ee 100644 --- a/packages/Symfony/tests/Rector/VarDumper/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php +++ b/packages/Symfony/tests/Rector/VarDumper/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php @@ -13,16 +13,11 @@ final class VarDumperTestTraitMethodArgsRectorTest extends AbstractRectorTestCas $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return VarDumperTestTraitMethodArgsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$traitName' => VarDumperTrait::class]; + return [VarDumperTestTraitMethodArgsRector::class => ['$traitName' => VarDumperTrait::class]]; } } diff --git a/packages/Twig/tests/Rector/SimpleFunctionAndFilterRector/SimpleFunctionAndFilterRectorTest.php b/packages/Twig/tests/Rector/SimpleFunctionAndFilterRector/SimpleFunctionAndFilterRectorTest.php index 82033767746..4be826dbf42 100644 --- a/packages/Twig/tests/Rector/SimpleFunctionAndFilterRector/SimpleFunctionAndFilterRectorTest.php +++ b/packages/Twig/tests/Rector/SimpleFunctionAndFilterRector/SimpleFunctionAndFilterRectorTest.php @@ -21,22 +21,17 @@ final class SimpleFunctionAndFilterRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return SimpleFunctionAndFilterRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [SimpleFunctionAndFilterRector::class => [ '$twigExtensionClass' => TwigExtension::class, '$oldToNewClasses' => [ TwigFunctionMethod::class => TwigSimpleFunction::class, TwigFilterMethod::class => TwigSimpleFilter::class, ], - ]; + ]]; } } diff --git a/src/Testing/PHPUnit/AbstractRectorTestCase.php b/src/Testing/PHPUnit/AbstractRectorTestCase.php index eb7da71a2ca..9119d686455 100644 --- a/src/Testing/PHPUnit/AbstractRectorTestCase.php +++ b/src/Testing/PHPUnit/AbstractRectorTestCase.php @@ -102,15 +102,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase return ''; } - /** - * @return mixed[] - */ - protected function getRectorConfiguration(): array - { - // can be implemented - return []; - } - /** * @return array */ @@ -200,7 +191,7 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase $enabledRectorsProvider->addEnabledRector($rectorClass, $rectorConfiguration); } } else { - $enabledRectorsProvider->addEnabledRector($this->getRectorClass(), $this->getRectorConfiguration()); + $enabledRectorsProvider->addEnabledRector($this->getRectorClass(), []); } } } diff --git a/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php b/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php index 7efa65a16ca..7f05da7bd4d 100644 --- a/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php +++ b/tests/Rector/Annotation/RenameAnnotationRector/RenameAnnotationRectorTest.php @@ -12,20 +12,15 @@ final class RenameAnnotationRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return RenameAnnotationRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameAnnotationRector::class => [ '$classToAnnotationMap' => [ 'PHPUnit\Framework\TestCase' => ['scenario' => 'test'], ], - ]; + ]]; } } diff --git a/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php b/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php index 0d5839a491b..f95ee605fb2 100644 --- a/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php +++ b/tests/Rector/Architecture/DependencyInjection/AnnotatedPropertyInjectToConstructorInjectionRector/AnnotatedPropertyInjectToConstructorInjectionRectorTest.php @@ -23,16 +23,11 @@ final class AnnotatedPropertyInjectToConstructorInjectionRectorTest extends Abst ]); } - protected function getRectorClass(): string - { - return AnnotatedPropertyInjectToConstructorInjectionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return ['$annotation' => 'inject']; + return [AnnotatedPropertyInjectToConstructorInjectionRector::class => ['$annotation' => 'inject']]; } } diff --git a/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php b/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php index 851365da4d2..46ef235d17f 100644 --- a/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php +++ b/tests/Rector/Architecture/Factory/NewObjectToFactoryCreateRector/NewObjectToFactoryCreateRectorTest.php @@ -14,22 +14,17 @@ final class NewObjectToFactoryCreateRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return NewObjectToFactoryCreateRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [NewObjectToFactoryCreateRector::class => [ '$objectToFactoryMethod' => [ MyClass::class => [ 'class' => MyClassFactory::class, 'method' => 'create', ], ], - ]; + ]]; } } diff --git a/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php b/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php index 99b68cfd816..f6a12b5790a 100644 --- a/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php +++ b/tests/Rector/Argument/ArgumentAdderRector/ArgumentAdderRectorTest.php @@ -18,17 +18,12 @@ final class ArgumentAdderRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ArgumentAdderRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ArgumentAdderRector::class => [ '$positionWithDefaultValueByMethodNamesByClassTypes' => [ SomeContainerBuilder::class => [ 'compile' => [ @@ -46,6 +41,6 @@ final class ArgumentAdderRectorTest extends AbstractRectorTestCase ], ], ], - ]; + ]]; } } diff --git a/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php b/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php index 2003a6607e5..9809532317c 100644 --- a/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php +++ b/tests/Rector/Argument/ArgumentDefaultValueReplacerRector/ArgumentDefaultValueReplacerRectorTest.php @@ -4,8 +4,6 @@ namespace Rector\Tests\Rector\Argument\ArgumentDefaultValueReplacerRector; use Rector\Rector\Argument\ArgumentDefaultValueReplacerRector; use Rector\Testing\PHPUnit\AbstractRectorTestCase; -use Symfony\Component\DependencyInjection\Definition; -use Symfony\Component\Yaml\Yaml; final class ArgumentDefaultValueReplacerRectorTest extends AbstractRectorTestCase { @@ -18,49 +16,46 @@ final class ArgumentDefaultValueReplacerRectorTest extends AbstractRectorTestCas ]); } - protected function getRectorClass(): string - { - return ArgumentDefaultValueReplacerRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { return [ - '$replacesByMethodAndTypes' => [ - Definition::class => [ - 'setScope' => [ - [ + ArgumentDefaultValueReplacerRector::class => [ + '$replacesByMethodAndTypes' => [ + 'Symfony\Component\DependencyInjection\Definition' => [ + 'setScope' => [ [ - 'before' => 'Symfony\Component\DependencyInjection\ContainerBuilder::SCOPE_PROTOTYPE', - 'after' => false, + [ + 'before' => 'Symfony\Component\DependencyInjection\ContainerBuilder::SCOPE_PROTOTYPE', + 'after' => false, + ], ], ], ], - ], - Yaml::class => [ - 'parse' => [1 => [[ - 'before' => ['false', 'false', 'true'], - 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT_FOR_MAP', - ], [ - 'before' => ['false', 'true'], - 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT', - ], [ - 'before' => 'false', - 'after' => 0, - ], [ - 'before' => 'true', - 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE', - ]]], - 'dump' => [3 => [[ - 'before' => ['false', 'true'], - 'after' => 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT', - ], [ - 'before' => 'true', - 'after' => 'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE', - ]]], + 'Symfony\Component\Yaml\Yaml' => [ + 'parse' => [1 => [[ + 'before' => ['false', 'false', 'true'], + 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT_FOR_MAP', + ], [ + 'before' => ['false', 'true'], + 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT', + ], [ + 'before' => 'false', + 'after' => 0, + ], [ + 'before' => 'true', + 'after' => 'Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE', + ]]], + 'dump' => [3 => [[ + 'before' => ['false', 'true'], + 'after' => 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT', + ], [ + 'before' => 'true', + 'after' => 'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE', + ]]], + ], ], ], ]; diff --git a/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php b/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php index 33be5aa2b31..09718672661 100644 --- a/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php +++ b/tests/Rector/Argument/ArgumentRemoverRector/ArgumentRemoverRectorTest.php @@ -19,32 +19,30 @@ final class ArgumentRemoverRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ArgumentRemoverRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { return [ - '$positionsByMethodNameByClassType' => [ - Persister::class => [ - 'getSelectJoinColumnSQL' => [ - 4 => null, + ArgumentRemoverRector::class => + [ + '$positionsByMethodNameByClassType' => [ + Persister::class => [ + 'getSelectJoinColumnSQL' => [ + 4 => null, + ], ], - ], - Yaml::class => [ - 'parse' => [ - 1 => ['Symfony\Component\Yaml\Yaml::PARSE_KEYS_AS_STRINGS', 'hey', 55, 5.5], + Yaml::class => [ + 'parse' => [ + 1 => ['Symfony\Component\Yaml\Yaml::PARSE_KEYS_AS_STRINGS', 'hey', 55, 5.5], + ], ], - ], - RemoveInTheMiddle::class => [ - 'run' => [ - 1 => [ - 'name' => 'second', + RemoveInTheMiddle::class => [ + 'run' => [ + 1 => [ + 'name' => 'second', + ], ], ], ], diff --git a/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php b/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php index 021f8ee2766..786cd42c39a 100644 --- a/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php +++ b/tests/Rector/Assign/PropertyAssignToMethodCallRector/PropertyAssignToMethodCallRectorTest.php @@ -14,21 +14,16 @@ final class PropertyAssignToMethodCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return PropertyAssignToMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [PropertyAssignToMethodCallRector::class => [ '$oldPropertiesToNewMethodCallsByType' => [ ChoiceControl::class => ['checkAllowedValues' => 'checkDefaultValue'], MultiChoiceControl::class => ['checkAllowedValues' => 'checkDefaultValue'], ], - ]; + ]]; } } diff --git a/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php b/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php index f389c7f7975..da3ac0908d7 100644 --- a/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php +++ b/tests/Rector/ClassLike/RemoveTraitRector/RemoveTraitRectorTest.php @@ -13,18 +13,13 @@ final class RemoveTraitRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return RemoveTraitRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RemoveTraitRector::class => [ '$traitsToRemove' => [TraitToBeRemoved::class], - ]; + ]]; } } diff --git a/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php b/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php index e2b9643c914..302890dbcbc 100644 --- a/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php +++ b/tests/Rector/ClassMethod/AddReturnTypeDeclarationRector/AddReturnTypeDeclarationRectorTest.php @@ -13,17 +13,12 @@ final class AddReturnTypeDeclarationRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/extended_parent.php.inc']); } - protected function getRectorClass(): string - { - return AddReturnTypeDeclarationRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [AddReturnTypeDeclarationRector::class => [ '$typehintForMethodByClass' => [ 'Rector\Tests\Rector\Typehint\AddReturnTypeDeclarationRector\Fixture\SomeClass' => [ 'parse' => 'array', @@ -35,6 +30,6 @@ final class AddReturnTypeDeclarationRectorTest extends AbstractRectorTestCase 'tearDown' => 'void', ], ], - ]; + ]]; } } diff --git a/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php b/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php index ce18a58456a..86a60918dd2 100644 --- a/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php +++ b/tests/Rector/ClassMethod/WrapReturnRector/WrapReturnRectorTest.php @@ -13,22 +13,17 @@ final class WrapReturnRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/already_array.php.inc']); } - protected function getRectorClass(): string - { - return WrapReturnRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [WrapReturnRector::class => [ '$typeToMethodToWrap' => [ SomeReturnClass::class => [ 'getItem' => 'array', ], ], - ]; + ]]; } } diff --git a/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php b/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php index f1b2f50d074..868e84a8d99 100644 --- a/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php +++ b/tests/Rector/Class_/ParentClassToTraitsRector/ParentClassToTraitsRectorTest.php @@ -22,21 +22,16 @@ final class ParentClassToTraitsRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ParentClassToTraitsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ParentClassToTraitsRector::class => [ '$parentClassToTraits' => [ ParentObject::class => [SomeTrait::class], AnotherParentObject::class => [SomeTrait::class, SecondTrait::class], ], - ]; + ]]; } } diff --git a/tests/Rector/Class_/RenameClassRector/RenameClassRectorTest.php b/tests/Rector/Class_/RenameClassRector/RenameClassRectorTest.php index c69625a14b4..9f4063b67a0 100644 --- a/tests/Rector/Class_/RenameClassRector/RenameClassRectorTest.php +++ b/tests/Rector/Class_/RenameClassRector/RenameClassRectorTest.php @@ -30,17 +30,12 @@ final class RenameClassRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RenameClassRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameClassRector::class => [ 'oldToNewClasses' => [ OldClass::class => NewClass::class, OldClassWithTypo::class => NewClassWithoutTypo::class, @@ -50,6 +45,6 @@ final class RenameClassRectorTest extends AbstractRectorTestCase 'Twig_AbstractManualExtension' => AbstractManualExtension::class, 'Twig_Extension_Sandbox' => 'Twig\Extension\SandboxExtension', ], - ]; + ]]; } } diff --git a/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php b/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php index 1ea811bc510..6cf3adb3efe 100644 --- a/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php +++ b/tests/Rector/Constant/RenameClassConstantRector/RenameClassConstantRectorTest.php @@ -14,17 +14,12 @@ final class RenameClassConstantRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return RenameClassConstantRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameClassConstantRector::class => [ 'oldToNewConstantsByClass' => [ LocalFormEvents::class => [ 'PRE_BIND' => 'PRE_SUBMIT', @@ -33,6 +28,6 @@ final class RenameClassConstantRectorTest extends AbstractRectorTestCase 'OLD_CONSTANT' => DifferentClass::class . '::NEW_CONSTANT', ], ], - ]; + ]]; } } diff --git a/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php b/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php index 1d8b91162bf..76e0985fa30 100644 --- a/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php +++ b/tests/Rector/Constant/RenameClassConstantsUseToStringsRector/RenameClassConstantsUseToStringsRectorTest.php @@ -13,17 +13,12 @@ final class RenameClassConstantsUseToStringsRectorTest extends AbstractRectorTes $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return RenameClassConstantsUseToStringsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameClassConstantsUseToStringsRector::class => [ '$oldConstantsToNewValuesByType' => [ Configurator::class => [ 'DEVELOPMENT' => 'development', @@ -31,6 +26,6 @@ final class RenameClassConstantsUseToStringsRectorTest extends AbstractRectorTes ], ], - ]; + ]]; } } diff --git a/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php b/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php index 0270b451c93..e12362c0d5b 100644 --- a/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php +++ b/tests/Rector/FuncCall/FunctionToNewRector/FunctionToNewRectorTest.php @@ -12,20 +12,15 @@ final class FunctionToNewRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return FunctionToNewRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FunctionToNewRector::class => [ '$functionToNew' => [ 'collection' => ['Collection'], ], - ]; + ]]; } } diff --git a/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php b/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php index af5d2265481..86d644834d9 100644 --- a/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php +++ b/tests/Rector/Function_/FunctionToMethodCallRector/FunctionToMethodCallRectorTest.php @@ -12,20 +12,15 @@ final class FunctionToMethodCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return FunctionToMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FunctionToMethodCallRector::class => [ '$functionToMethodCall' => [ 'view' => ['this', 'render'], ], - ]; + ]]; } } diff --git a/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php b/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php index 6de6fd22f0d..0d84c3df809 100644 --- a/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php +++ b/tests/Rector/Function_/FunctionToStaticCallRector/FunctionToStaticCallRectorTest.php @@ -12,21 +12,16 @@ final class FunctionToStaticCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return FunctionToStaticCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FunctionToStaticCallRector::class => [ '$functionToStaticCall' => [ 'view' => ['SomeStaticClass', 'render'], 'SomeNamespaced\view' => ['AnotherStaticClass', 'render'], ], - ]; + ]]; } } diff --git a/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php b/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php index 91ab081629e..6e479033de9 100644 --- a/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php +++ b/tests/Rector/Function_/RenameFunctionRector/RenameFunctionRectorTest.php @@ -16,22 +16,17 @@ final class RenameFunctionRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RenameFunctionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameFunctionRector::class => [ '$oldFunctionToNewFunction' => [ 'view' => 'Laravel\Templating\render', 'sprintf' => 'Safe\sprintf', 'hebrevc' => ['nl2br', 'hebrev'], ], - ]; + ]]; } } diff --git a/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php b/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php index 6b61207459c..180cf05ab87 100644 --- a/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php +++ b/tests/Rector/Interface_/MergeInterfacesRector/MergeInterfacesRectorTest.php @@ -14,20 +14,15 @@ final class MergeInterfacesRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return MergeInterfacesRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [MergeInterfacesRector::class => [ '$oldToNewInterfaces' => [ SomeOldInterface::class => SomeInterface::class, ], - ]; + ]]; } } diff --git a/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php b/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php index bddce2015b5..89498993f50 100644 --- a/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php +++ b/tests/Rector/Interface_/RemoveInterfacesRector/RemoveInterfacesRectorTest.php @@ -13,18 +13,13 @@ final class RemoveInterfacesRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return RemoveInterfacesRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RemoveInterfacesRector::class => [ '$interfacesToRemove' => [SomeInterface::class], - ]; + ]]; } } diff --git a/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php index 54555ecef51..2fb8204ce4a 100644 --- a/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/GetAndSetToMethodCallRector/GetAndSetToMethodCallRectorTest.php @@ -19,17 +19,12 @@ final class GetAndSetToMethodCallRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return GetAndSetToMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [GetAndSetToMethodCallRector::class => [ '$typeToMethodCalls' => [ SomeContainer::class => [ 'get' => 'getService', @@ -43,6 +38,6 @@ final class GetAndSetToMethodCallRectorTest extends AbstractRectorTestCase 'get' => 'get', ], ], - ]; + ]]; } } diff --git a/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php index d865cfc78c6..d3792b7e901 100644 --- a/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/ToStringToMethodCallRector/ToStringToMethodCallRectorTest.php @@ -13,20 +13,15 @@ final class ToStringToMethodCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return ToStringToMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ToStringToMethodCallRector::class => [ '$methodNamesByType' => [ ConfigCache::class => 'getPath', ], - ]; + ]]; } } diff --git a/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php b/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php index bcab8d454a5..74ffa20d969 100644 --- a/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php +++ b/tests/Rector/MagicDisclosure/UnsetAndIssetToMethodCallRector/UnsetAndIssetToMethodCallRectorTest.php @@ -13,23 +13,18 @@ final class UnsetAndIssetToMethodCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return UnsetAndIssetToMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [UnsetAndIssetToMethodCallRector::class => [ '$typeToMethodCalls' => [ Container::class => [ 'isset' => 'hasService', 'unset' => 'removeService', ], ], - ]; + ]]; } } diff --git a/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php b/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php index 7c7e3e4900a..199edadc530 100644 --- a/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php +++ b/tests/Rector/MethodBody/FluentReplaceRector/FluentReplaceRectorTest.php @@ -13,18 +13,13 @@ final class FluentReplaceRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return FluentReplaceRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [FluentReplaceRector::class => [ '$classesToDefluent' => [FluentInterfaceClass::class], - ]; + ]]; } } diff --git a/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php b/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php index c5a1df10870..d1fc473f220 100644 --- a/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php +++ b/tests/Rector/MethodBody/NormalToFluentRector/NormalToFluentRectorTest.php @@ -18,20 +18,15 @@ final class NormalToFluentRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return NormalToFluentRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [NormalToFluentRector::class => [ '$fluentMethodsByType' => [ FluentInterfaceClass::class => ['someFunction', 'otherFunction', 'joinThisAsWell'], ], - ]; + ]]; } } diff --git a/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php b/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php index abe5ce5c13f..98f3d7f6e5d 100644 --- a/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php +++ b/tests/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector/MethodCallToAnotherMethodCallWithArgumentsRectorTest.php @@ -13,20 +13,15 @@ final class MethodCallToAnotherMethodCallWithArgumentsRectorTest extends Abstrac $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return MethodCallToAnotherMethodCallWithArgumentsRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [MethodCallToAnotherMethodCallWithArgumentsRector::class => [ '$oldMethodsToNewMethodsWithArgsByType' => [ NetteServiceDefinition::class => ['setInject' => ['addTag', ['inject']]], ], - ]; + ]]; } } diff --git a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php index ac32118b16f..bd80e065d78 100644 --- a/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php +++ b/tests/Rector/MethodCall/RenameMethodCallRector/RenameMethodCallRectorTest.php @@ -19,17 +19,12 @@ final class RenameMethodCallRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RenameMethodCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameMethodCallRector::class => [ '$oldToNewMethodsByClass' => [ Html::class => [ 'add' => 'addHtml', @@ -42,6 +37,6 @@ final class RenameMethodCallRectorTest extends AbstractRectorTestCase 'createHtml' => 'testHtml', ], ], - ]; + ]]; } } diff --git a/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php b/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php index 994928ec4df..af0f6542f0e 100644 --- a/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php +++ b/tests/Rector/MethodCall/RenameMethodRector/RenameMethodRectorTest.php @@ -24,17 +24,12 @@ final class RenameMethodRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RenameMethodRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameMethodRector::class => [ '$oldToNewMethodsByClass' => [ AbstractType::class => [ 'setDefaultOptions' => 'configureOptions', @@ -53,6 +48,6 @@ final class RenameMethodRectorTest extends AbstractRectorTestCase 'run' => '__invoke', ], ], - ]; + ]]; } } diff --git a/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php b/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php index 6c706f24e1c..d0ccafa6f30 100644 --- a/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php +++ b/tests/Rector/MethodCall/RenameStaticMethodRector/RenameStaticMethodRectorTest.php @@ -14,21 +14,16 @@ final class RenameStaticMethodRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return RenameStaticMethodRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameStaticMethodRector::class => [ '$oldToNewMethodByClasses' => [ Html::class => ['add' => 'addHtml'], FormMacros::class => ['renderFormBegin' => ['Nette\Bridges\FormsLatte\Runtime', 'renderFormBegin']], ], - ]; + ]]; } } diff --git a/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php b/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php index 0b9c492402b..e258fafe88c 100644 --- a/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php +++ b/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/PseudoNamespaceToNamespaceRectorTest.php @@ -20,22 +20,17 @@ final class PseudoNamespaceToNamespaceRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return PseudoNamespaceToNamespaceRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [PseudoNamespaceToNamespaceRector::class => [ '$namespacePrefixesWithExcludedClasses' => [ // namespace prefix => excluded classes 'PHPUnit_' => ['PHPUnit_Framework_MockObject_MockObject'], 'ChangeMe_' => ['KeepMe_'], ], - ]; + ]]; } } diff --git a/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php b/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php index 0dac07f626b..990c526ad19 100644 --- a/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php +++ b/tests/Rector/Namespace_/RenameNamespaceRector/RenameNamespaceRectorTest.php @@ -18,23 +18,18 @@ final class RenameNamespaceRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return RenameNamespaceRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenameNamespaceRector::class => [ '$oldToNewNamespaces' => [ 'OldNamespace' => 'NewNamespace', 'OldNamespaceWith\OldSplitNamespace' => 'NewNamespaceWith\NewSplitNamespace', 'Old\Long\AnyNamespace' => 'Short\AnyNamespace', 'PHPUnit_Framework_' => 'PHPUnit\Framework\\', ], - ]; + ]]; } } diff --git a/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php b/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php index 74afa2db665..a3d9fcddf4b 100644 --- a/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php +++ b/tests/Rector/New_/NewToStaticCallRector/NewToStaticCallRectorTest.php @@ -14,20 +14,15 @@ final class NewToStaticCallRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return NewToStaticCallRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [NewToStaticCallRector::class => [ '$typeToStaticCalls' => [ FromNewClass::class => [IntoStaticClass::class, 'run'], ], - ]; + ]]; } } diff --git a/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php b/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php index 1d8c47c0340..18814c9c8b1 100644 --- a/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php +++ b/tests/Rector/Property/PropertyToMethodRector/PropertyToMethodRectorTest.php @@ -13,17 +13,12 @@ final class PropertyToMethodRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return PropertyToMethodRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [PropertyToMethodRector::class => [ '$perClassPropertyToMethods' => [ Translator::class => [ 'locale' => [ @@ -40,6 +35,6 @@ final class PropertyToMethodRectorTest extends AbstractRectorTestCase ], ], ], - ]; + ]]; } } diff --git a/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php b/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php index 90c07841972..74946bf1870 100644 --- a/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php +++ b/tests/Rector/Property/RenamePropertyRector/RenamePropertyRectorTest.php @@ -13,23 +13,18 @@ final class RenamePropertyRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return RenamePropertyRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [RenamePropertyRector::class => [ '$oldToNewPropertyByTypes' => [ ClassWithProperties::class => [ 'oldProperty' => 'newProperty', 'anotherOldProperty' => 'anotherNewProperty', ], ], - ]; + ]]; } } diff --git a/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php b/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php index b9513a216a7..3c85837ff51 100644 --- a/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php +++ b/tests/Rector/StaticCall/StaticCallToFunctionRector/StaticCallToFunctionRectorTest.php @@ -13,20 +13,15 @@ final class StaticCallToFunctionRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return StaticCallToFunctionRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [StaticCallToFunctionRector::class => [ '$staticCallToFunctionByType' => [ SomeOldStaticClass::class => ['render' => 'view'], ], - ]; + ]]; } } diff --git a/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php b/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php index a8a92ce46db..df2e527a451 100644 --- a/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php +++ b/tests/Rector/String_/StringToClassConstantRector/StringToClassConstantRectorTest.php @@ -12,21 +12,16 @@ final class StringToClassConstantRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']); } - protected function getRectorClass(): string - { - return StringToClassConstantRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [StringToClassConstantRector::class => [ '$stringsToClassConstants' => [ 'compiler.post_dump' => ['Yet\AnotherClass', 'CONSTANT'], 'compiler.to_class' => ['Yet\AnotherClass', 'class'], ], - ]; + ]]; } } diff --git a/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php b/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php index 378bb309ea9..601b2c256ec 100644 --- a/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php +++ b/tests/Rector/Typehint/ParentTypehintedArgumentRector/ParentTypehintedArgumentRectorTest.php @@ -17,21 +17,16 @@ final class ParentTypehintedArgumentRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ParentTypehintedArgumentRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ParentTypehintedArgumentRector::class => [ '$typehintForArgumentByMethodAndClass' => [ ParserInterface::class => ['parse' => ['code' => 'string']], ClassMetadataFactory::class => ['setEntityManager' => ['$em' => 'Doctrine\ORM\EntityManagerInterface']], ], - ]; + ]]; } } diff --git a/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php b/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php index 28e66279d3a..da4e327954e 100644 --- a/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangeConstantVisibilityRector/ChangeConstantVisibilityRectorTest.php @@ -13,17 +13,12 @@ final class ChangeConstantVisibilityRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return ChangeConstantVisibilityRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ChangeConstantVisibilityRector::class => [ '$constantToVisibilityByClass' => [ ParentObject::class => [ 'TO_BE_PUBLIC_CONSTANT' => 'public', @@ -32,6 +27,6 @@ final class ChangeConstantVisibilityRectorTest extends AbstractRectorTestCase ], 'Rector\Tests\Rector\Visibility\ChangePropertyVisibilityRector\Source\AnotherClassWithInvalidConstants' => ['TO_BE_PRIVATE_CONSTANT' => 'private'], ], - ]; + ]]; } } diff --git a/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php b/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php index 8a778990e4a..09f3a223e45 100644 --- a/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangeMethodVisibilityRector/ChangeMethodVisibilityRectorTest.php @@ -13,17 +13,12 @@ final class ChangeMethodVisibilityRectorTest extends AbstractRectorTestCase $this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc', __DIR__ . '/Fixture/fixture2.php.inc']); } - protected function getRectorClass(): string - { - return ChangeMethodVisibilityRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ChangeMethodVisibilityRector::class => [ '$methodToVisibilityByClass' => [ ParentObject::class => [ 'toBePublicMethod' => 'public', @@ -32,6 +27,6 @@ final class ChangeMethodVisibilityRectorTest extends AbstractRectorTestCase 'toBePublicStaticMethod' => 'public', ], ], - ]; + ]]; } } diff --git a/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php b/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php index e658b84c051..dc5b7bb4e58 100644 --- a/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php +++ b/tests/Rector/Visibility/ChangePropertyVisibilityRector/ChangePropertyVisibilityRectorTest.php @@ -17,17 +17,12 @@ final class ChangePropertyVisibilityRectorTest extends AbstractRectorTestCase ]); } - protected function getRectorClass(): string - { - return ChangePropertyVisibilityRector::class; - } - /** * @return mixed[] */ - protected function getRectorConfiguration(): array + protected function getRectorsWithConfiguration(): array { - return [ + return [ChangePropertyVisibilityRector::class => [ '$propertyToVisibilityByClass' => [ ParentObject::class => [ 'toBePublicProperty' => 'public', @@ -39,6 +34,6 @@ final class ChangePropertyVisibilityRectorTest extends AbstractRectorTestCase 'toBePublicStaticProperty' => 'public', ], ], - ]; + ]]; } }