mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-14 04:22:17 +02:00
merge getRectorClass() and getRectorConfiguration()
This commit is contained in:
parent
c3dd955f7d
commit
1fe23d12c8
@ -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,
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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)*#'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,6 @@ final class DocBlockManipulator
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function addReturnTag(Node $node, string $type): void
|
||||
{
|
||||
// there might be no phpdoc at all
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -102,15 +102,6 @@ abstract class AbstractRectorTestCase extends AbstractKernelTestCase
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[]
|
||||
*/
|
||||
protected function getRectorConfiguration(): array
|
||||
{
|
||||
// can be implemented
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, 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(), []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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']];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
], ],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
]]],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
],
|
||||
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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']]],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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']],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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_'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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\\',
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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']],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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'],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user