mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 22:08:00 +01:00
Merge pull request #3818 from rectorphp/core-to-generic
Move src/Rector to rules/generic/src/Rector, Core namespace for rules to Generic
This commit is contained in:
commit
32a89e85e1
@ -67,6 +67,7 @@
|
||||
"Rector\\ChangesReporting\\": "packages/changes-reporting/src",
|
||||
"Rector\\CodeQuality\\": "rules/code-quality/src",
|
||||
"Rector\\NodeRemoval\\": "packages/node-removal/src",
|
||||
"Rector\\Generic\\": "rules/generic/src",
|
||||
"Rector\\Reporting\\": "packages/reporting/src",
|
||||
"Rector\\CodingStyle\\": "rules/coding-style/src",
|
||||
"Rector\\ConsoleDiffer\\": "packages/console-differ/src",
|
||||
@ -166,6 +167,7 @@
|
||||
"Rector\\Doctrine\\Tests\\": "rules/doctrine/tests",
|
||||
"Rector\\DynamicTypeAnalysis\\Tests\\": "packages/dynamic-type-analysis/tests",
|
||||
"Rector\\Guzzle\\Tests\\": "rules/guzzle/tests",
|
||||
"Rector\\Generic\\Tests\\": "rules/generic/tests",
|
||||
"Rector\\JMS\\Tests\\": "rules/jms/tests",
|
||||
"Rector\\Laravel\\Tests\\": "rules/laravel/tests",
|
||||
"Rector\\Legacy\\Tests\\": "rules/legacy/tests",
|
||||
@ -236,7 +238,7 @@
|
||||
"rules/cakephp/tests/Rector/StaticCall/AppUsesStaticCallToUseStatementRector/Source",
|
||||
"tests/Source",
|
||||
"rules/psr4/tests/Rector/MultipleClassFileToPsr4ClassesRector/Source",
|
||||
"tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source"
|
||||
"rules/generic/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source"
|
||||
],
|
||||
"files": [
|
||||
"rules/coding-style/tests/Rector/Throw_/AnnotateThrowablesRector/Source/i_throw_an_exception.func.php",
|
||||
@ -248,7 +250,7 @@
|
||||
"rules/renaming/tests/Rector/Class_/RenameClassRector/Source/Twig_Extension_Sandbox.php",
|
||||
"rules/renaming/tests/Rector/Class_/RenameClassRector/Source/TwigFilter.php",
|
||||
"rules/renaming/tests/Rector/Class_/RenameClassRector/Source/Manual_Twig_Filter.php",
|
||||
"tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source/ChangeMeAnotherNamespace.php",
|
||||
"rules/generic/tests/Rector/Namespace_/PseudoNamespaceToNamespaceRector/Source/ChangeMeAnotherNamespace.php",
|
||||
"rules/coding-style/tests/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source/Foo.php",
|
||||
"rules/coding-style/tests/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source/Function_/count.php",
|
||||
"rules/coding-style/tests/Rector/Namespace_/ImportFullyQualifiedNamesRector/Source/AnotherClass.php",
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
use Rector\Core\Rector\Architecture\DependencyInjection\ReplaceVariableByPropertyFetchRector;
|
||||
use Rector\Generic\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
use Rector\Generic\Rector\Architecture\DependencyInjection\ReplaceVariableByPropertyFetchRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -3,10 +3,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\MethodCall\ModalToGetSetRector;
|
||||
use Rector\Core\Rector\MethodBody\NormalToFluentRector;
|
||||
use Rector\Core\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Core\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\MethodBody\NormalToFluentRector;
|
||||
use Rector\Generic\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Generic\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Generic\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\MethodCall\ModalToGetSetRector;
|
||||
use Rector\CakePHP\Rector\Name\ChangeSnakedFixtureNameToCamelRector;
|
||||
use Rector\Core\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector;
|
||||
use Rector\Core\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Generic\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector;
|
||||
use Rector\Generic\Rector\Property\PropertyToMethodRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -4,8 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
use Rector\CakePHP\Rector\MethodCall\ModalToGetSetRector;
|
||||
use Rector\CakePHP\Rector\MethodCall\RenameMethodCallBasedOnParameterRector;
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Core\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\Constant\RenameClassConstantRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Class_\AddInterfaceByTraitRector;
|
||||
use Rector\Doctrine\Rector\Class_\AddEntityIdByConditionRector;
|
||||
use Rector\Generic\Rector\Class_\AddInterfaceByTraitRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\MethodCall\ServiceGetterToConstructorInjectionRector;
|
||||
use Rector\Generic\Rector\MethodCall\ServiceGetterToConstructorInjectionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use GuzzleHttp\Cookie\SetCookie;
|
||||
use Rector\Core\Rector\Function_\FunctionToMethodCallRector;
|
||||
use Rector\Core\Rector\StaticCall\StaticCallToFunctionRector;
|
||||
use Rector\Generic\Rector\Function_\FunctionToMethodCallRector;
|
||||
use Rector\Generic\Rector\StaticCall\StaticCallToFunctionRector;
|
||||
use Rector\Guzzle\Rector\MethodCall\MessageAsArrayRector;
|
||||
use Rector\MagicDisclosure\Rector\ClassMethod\ReturnThisRemoveRector;
|
||||
use Rector\MagicDisclosure\Rector\MethodCall\DefluentMethodCallRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Property\InjectAnnotationClassRector;
|
||||
use Rector\Generic\Rector\Property\InjectAnnotationClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\NetteToSymfony\Rector\MethodCall\WrapTransParameterNameRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Function_\FunctionToStaticCallRector;
|
||||
use Rector\Generic\Rector\Function_\FunctionToStaticCallRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\FuncCall\FunctionToNewRector;
|
||||
use Rector\Generic\Rector\FuncCall\FunctionToNewRector;
|
||||
use Rector\Laravel\Rector\FuncCall\HelperFunctionToConstructorInjectionRector;
|
||||
use Rector\Laravel\Rector\StaticCall\FacadeStaticCallToConstructorInjectionRector;
|
||||
use Rector\Laravel\Rector\StaticCall\RequestStaticValidateToInjectRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\String_\StringToClassConstantRector;
|
||||
use Rector\Generic\Rector\String_\StringToClassConstantRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassLike\RemoveTraitRector;
|
||||
use Rector\Generic\Rector\ClassLike\RemoveTraitRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\String_\StringToClassConstantRector;
|
||||
use Rector\Generic\Rector\String_\StringToClassConstantRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Generic\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Core\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Laravel\Rector\StaticCall\Redirect301ToPermanentRedirectRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Core\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\Property\RenamePropertyRector;
|
||||
use Rector\Laravel\Rector\StaticCall\MinutesToSecondsInCacheRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Core\Rector\MethodCall\MethodCallToReturnRector;
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\MethodCall\MethodCallToReturnRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameStaticMethodRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\SwapFuncCallArgumentsRector;
|
||||
use Rector\Generic\Rector\Argument\SwapFuncCallArgumentsRector;
|
||||
use Rector\MysqlToMysqli\Rector\Assign\MysqlAssignToMysqliRector;
|
||||
use Rector\MysqlToMysqli\Rector\FuncCall\MysqlFuncCallToMysqliRector;
|
||||
use Rector\MysqlToMysqli\Rector\FuncCall\MysqlPConnectToMysqliConnectRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\MethodCall\MethodCallToStaticCallRector;
|
||||
use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector;
|
||||
use Rector\Generic\Rector\MethodCall\MethodCallToStaticCallRector;
|
||||
use Rector\Nette\Rector\MethodCall\AddDatePickerToDateControlRector;
|
||||
use Rector\Nette\Rector\MethodCall\GetConfigWithDefaultsArgumentToArrayMergeInCompilerExtensionRector;
|
||||
use Rector\Nette\Rector\MethodCall\SetClassWithArgumentToSetFactoryRector;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Core\Rector\Interface_\RemoveInterfacesRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\Interface_\RemoveInterfacesRector;
|
||||
use Rector\NetteToSymfony\Rector\Assign\FormControlToControllerAndFormTypeRector;
|
||||
use Rector\NetteToSymfony\Rector\ClassMethod\RouterListToControllerAnnotationsRector;
|
||||
use Rector\NetteToSymfony\Rector\FileSystem\DeleteFactoryInterfaceRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Function_\FunctionToStaticCallRector;
|
||||
use Rector\Generic\Rector\Function_\FunctionToStaticCallRector;
|
||||
use Rector\Nette\Rector\FuncCall\FilePutContentsToFileSystemWriteRector;
|
||||
use Rector\Nette\Rector\FuncCall\JsonDecodeEncodeToNetteUtilsJsonDecodeEncodeRector;
|
||||
use Rector\Nette\Rector\FuncCall\PregFunctionToNetteUtilsStringsRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\StaticCall\SwapClassMethodArgumentsRector;
|
||||
use Rector\Generic\Rector\StaticCall\SwapClassMethodArgumentsRector;
|
||||
use Rector\Phalcon\Rector\Assign\FlashWithCssClassesToExtraCallRector;
|
||||
use Rector\Phalcon\Rector\Assign\NewApplicationToToFactoryWithDefaultContainerRector;
|
||||
use Rector\Phalcon\Rector\MethodCall\AddRequestToHandleMethodCallRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Property\InjectAnnotationClassRector;
|
||||
use Rector\Generic\Rector\Property\InjectAnnotationClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\FuncCall\RemoveFuncCallArgRector;
|
||||
use Rector\Generic\Rector\FuncCall\RemoveFuncCallArgRector;
|
||||
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
|
||||
use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Namespace_\PseudoNamespaceToNamespaceRector;
|
||||
use Rector\Generic\Rector\Namespace_\PseudoNamespaceToNamespaceRector;
|
||||
use Rector\PHPUnit\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector;
|
||||
use Rector\PHPUnit\Rector\MethodCall\GetMockBuilderGetMockToCreateMockRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\PHPUnit\Rector\MethodCall\AssertEqualsParameterToSpecificMethodsTypeRector;
|
||||
use Rector\PHPUnit\Rector\MethodCall\ReplaceAssertArraySubsetRector;
|
||||
use Rector\PHPUnit\Rector\MethodCall\SpecificAssertContainsRector;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Symfony\Rector\Yaml\ParseFileRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Symfony\Rector\Console\ConsoleExceptionToErrorEventConstantRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Core\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Core\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Core\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Core\Rector\ClassMethod\WrapReturnRector;
|
||||
use Rector\Core\Rector\New_\NewToStaticCallRector;
|
||||
use Rector\Core\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentRemoverRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddReturnTypeDeclarationRector;
|
||||
use Rector\Generic\Rector\ClassMethod\WrapReturnRector;
|
||||
use Rector\Generic\Rector\New_\NewToStaticCallRector;
|
||||
use Rector\Generic\Rector\Visibility\ChangeMethodVisibilityRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Core\Rector\ClassMethod\AddMethodParentCallRector;
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Generic\Rector\ClassMethod\AddMethodParentCallRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Symfony\Rector\MethodCall\MakeDispatchFirstArgumentEventRector;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Rector\Namespace_\PseudoNamespaceToNamespaceRector;
|
||||
use Rector\Generic\Rector\Namespace_\PseudoNamespaceToNamespaceRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@ use Rector\BetterPhpDocParser\Attributes\Ast\PhpDoc\SpacelessPhpDocTagNode;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\AttributeAwareNodeInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\ShortNameAwareTagInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\TypeAwareTagValueNodeInterface;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocRemover;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
|
||||
use Rector\Core\Exception\NotImplementedException;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
@ -80,6 +81,11 @@ final class PhpDocInfo
|
||||
*/
|
||||
private $phpDocTypeChanger;
|
||||
|
||||
/**
|
||||
* @var PhpDocRemover
|
||||
*/
|
||||
private $phpDocRemover;
|
||||
|
||||
/**
|
||||
* @param mixed[] $tokens
|
||||
*/
|
||||
@ -89,7 +95,8 @@ final class PhpDocInfo
|
||||
string $originalContent,
|
||||
StaticTypeMapper $staticTypeMapper,
|
||||
Node $node,
|
||||
PhpDocTypeChanger $phpDocTypeChanger
|
||||
PhpDocTypeChanger $phpDocTypeChanger,
|
||||
PhpDocRemover $phpDocRemover
|
||||
) {
|
||||
$this->phpDocNode = $attributeAwarePhpDocNode;
|
||||
$this->tokens = $tokens;
|
||||
@ -98,6 +105,7 @@ final class PhpDocInfo
|
||||
$this->staticTypeMapper = $staticTypeMapper;
|
||||
$this->node = $node;
|
||||
$this->phpDocTypeChanger = $phpDocTypeChanger;
|
||||
$this->phpDocRemover = $phpDocRemover;
|
||||
}
|
||||
|
||||
public function getOriginalContent(): string
|
||||
@ -205,17 +213,7 @@ final class PhpDocInfo
|
||||
|
||||
public function removeTagValueNodeFromNode(PhpDocTagValueNode $phpDocTagValueNode): void
|
||||
{
|
||||
foreach ($this->phpDocNode->children as $key => $phpDocChildNode) {
|
||||
if (! $phpDocChildNode instanceof PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($phpDocChildNode->value !== $phpDocTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($this->phpDocNode->children[$key]);
|
||||
}
|
||||
$this->phpDocRemover->removeTagValueFromNode($this, $phpDocTagValueNode);
|
||||
}
|
||||
|
||||
public function hasByType(string $type): bool
|
||||
@ -302,17 +300,7 @@ final class PhpDocInfo
|
||||
|
||||
public function removeByName(string $name): void
|
||||
{
|
||||
foreach ($this->phpDocNode->children as $key => $phpDocChildNode) {
|
||||
if (! $phpDocChildNode instanceof PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $this->areAnnotationNamesEqual($name, $phpDocChildNode->name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($this->phpDocNode->children[$key]);
|
||||
}
|
||||
$this->phpDocRemover->removeByName($this, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -458,14 +446,6 @@ final class PhpDocInfo
|
||||
));
|
||||
}
|
||||
|
||||
private function areAnnotationNamesEqual(string $firstAnnotationName, string $secondAnnotationName): bool
|
||||
{
|
||||
$firstAnnotationName = trim($firstAnnotationName, '@');
|
||||
$secondAnnotationName = trim($secondAnnotationName, '@');
|
||||
|
||||
return $firstAnnotationName === $secondAnnotationName;
|
||||
}
|
||||
|
||||
private function resolveNameForPhpDocTagValueNode(PhpDocTagValueNode $phpDocTagValueNode): string
|
||||
{
|
||||
if ($phpDocTagValueNode instanceof ReturnTagValueNode) {
|
||||
|
@ -13,6 +13,7 @@ use Rector\BetterPhpDocParser\Attributes\Ast\AttributeAwareNodeFactory;
|
||||
use Rector\BetterPhpDocParser\Attributes\Attribute\Attribute;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\AttributeAwareNodeInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNodeFactoryInterface;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocRemover;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
|
||||
use Rector\BetterPhpDocParser\ValueObject\StartEndValueObject;
|
||||
use Rector\Core\Configuration\CurrentNodeProvider;
|
||||
@ -51,11 +52,17 @@ final class PhpDocInfoFactory
|
||||
*/
|
||||
private $phpDocTypeChanger;
|
||||
|
||||
/**
|
||||
* @var PhpDocRemover
|
||||
*/
|
||||
private $phpDocRemover;
|
||||
|
||||
public function __construct(
|
||||
AttributeAwareNodeFactory $attributeAwareNodeFactory,
|
||||
CurrentNodeProvider $currentNodeProvider,
|
||||
Lexer $lexer,
|
||||
PhpDocParser $phpDocParser,
|
||||
PhpDocRemover $phpDocRemover,
|
||||
PhpDocTypeChanger $phpDocTypeChanger,
|
||||
StaticTypeMapper $staticTypeMapper
|
||||
) {
|
||||
@ -65,6 +72,7 @@ final class PhpDocInfoFactory
|
||||
$this->staticTypeMapper = $staticTypeMapper;
|
||||
$this->attributeAwareNodeFactory = $attributeAwareNodeFactory;
|
||||
$this->phpDocTypeChanger = $phpDocTypeChanger;
|
||||
$this->phpDocRemover = $phpDocRemover;
|
||||
}
|
||||
|
||||
public function createFromNode(Node $node): ?PhpDocInfo
|
||||
@ -147,7 +155,8 @@ final class PhpDocInfoFactory
|
||||
$content,
|
||||
$this->staticTypeMapper,
|
||||
$node,
|
||||
$this->phpDocTypeChanger
|
||||
$this->phpDocTypeChanger,
|
||||
$this->phpDocRemover
|
||||
);
|
||||
$node->setAttribute(AttributeKey::PHP_DOC_INFO, $phpDocInfo);
|
||||
|
||||
|
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\BetterPhpDocParser\PhpDocManipulator;
|
||||
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
|
||||
final class PhpDocRemover
|
||||
{
|
||||
public function removeByName(PhpDocInfo $phpDocInfo, string $name): void
|
||||
{
|
||||
$attributeAwarePhpDocNode = $phpDocInfo->getPhpDocNode();
|
||||
|
||||
foreach ($attributeAwarePhpDocNode->children as $key => $phpDocChildNode) {
|
||||
if (! $phpDocChildNode instanceof PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $this->areAnnotationNamesEqual($name, $phpDocChildNode->name)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($attributeAwarePhpDocNode->children[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeTagValueFromNode(PhpDocInfo $phpDocInfo, PhpDocTagValueNode $phpDocTagValueNode): void
|
||||
{
|
||||
$attributeAwarePhpDocNode = $phpDocInfo->getPhpDocNode();
|
||||
|
||||
foreach ($attributeAwarePhpDocNode->children as $key => $phpDocChildNode) {
|
||||
if (! $phpDocChildNode instanceof PhpDocTagNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($phpDocChildNode->value !== $phpDocTagValueNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($attributeAwarePhpDocNode->children[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
private function areAnnotationNamesEqual(string $firstAnnotationName, string $secondAnnotationName): bool
|
||||
{
|
||||
$firstAnnotationName = trim($firstAnnotationName, '@');
|
||||
$secondAnnotationName = trim($secondAnnotationName, '@');
|
||||
|
||||
return $firstAnnotationName === $secondAnnotationName;
|
||||
}
|
||||
}
|
@ -60,15 +60,12 @@ final class DumpRectorsCommand extends AbstractCommand
|
||||
__DIR__ . '/../../../../rules',
|
||||
__DIR__ . '/../../../../packages',
|
||||
]);
|
||||
|
||||
$generalRectors = $this->rectorsFinder->findInDirectory(__DIR__ . '/../../../../src');
|
||||
} else {
|
||||
// custom directory
|
||||
$rulesRectors = $this->rectorsFinder->findInDirectories($source);
|
||||
$generalRectors = [];
|
||||
}
|
||||
|
||||
$this->markdownDumpRectorsOutputFormatter->format($rulesRectors, $generalRectors, $isRectorProject);
|
||||
$this->markdownDumpRectorsOutputFormatter->format($rulesRectors, $isRectorProject);
|
||||
|
||||
return ShellCode::SUCCESS;
|
||||
}
|
||||
|
@ -70,11 +70,10 @@ final class MarkdownDumpRectorsOutputFormatter
|
||||
|
||||
/**
|
||||
* @param RectorInterface[] $packageRectors
|
||||
* @param RectorInterface[] $generalRectors
|
||||
*/
|
||||
public function format(array $packageRectors, array $generalRectors, bool $isRectorProject): void
|
||||
public function format(array $packageRectors, bool $isRectorProject): void
|
||||
{
|
||||
$totalRectorCount = count($packageRectors) + count($generalRectors);
|
||||
$totalRectorCount = count($packageRectors);
|
||||
$message = sprintf('# All %d Rectors Overview', $totalRectorCount);
|
||||
|
||||
$this->symfonyStyle->writeln($message);
|
||||
@ -82,10 +81,7 @@ final class MarkdownDumpRectorsOutputFormatter
|
||||
|
||||
if ($isRectorProject) {
|
||||
$this->symfonyStyle->writeln('- [Projects](#projects)');
|
||||
$this->symfonyStyle->writeln('- [General](#general)');
|
||||
|
||||
$this->printRectorsWithHeadline($packageRectors, 'Projects');
|
||||
$this->printRectorsWithHeadline($generalRectors, 'General');
|
||||
} else {
|
||||
$this->printRectors($packageRectors, $isRectorProject);
|
||||
}
|
||||
|
@ -184,8 +184,8 @@ parameters:
|
||||
- '#Class Rector\\DynamicTypeAnalysis\\Tests\\Rector\\ClassMethod\\AddArgumentTypeWithProbeDataRector\\Fixture\\SomeClass not found#'
|
||||
|
||||
-
|
||||
message: '#Class Rector\\Core\\Tests\\Rector\\StaticCall\\SwapClassMethodArgumentsRector\\Fixture\\SomeClass not found#'
|
||||
path: tests/Rector/StaticCall/SwapClassMethodArgumentsRector/SwapClassMethodArgumentsRectorTest.php
|
||||
message: '#Class Rector\\Generic\\Tests\\Rector\\StaticCall\\SwapClassMethodArgumentsRector\\Fixture\\SomeClass not found#'
|
||||
path: rules/generic/tests/Rector/StaticCall/SwapClassMethodArgumentsRector/SwapClassMethodArgumentsRectorTest.php
|
||||
|
||||
# internal rule
|
||||
- '#Class "Rector\\Utils\\(.*?)" is missing @see annotation with test case class reference#'
|
||||
@ -233,7 +233,7 @@ parameters:
|
||||
- '#Parameter \#1 \$nodes of method Rector\\Core\\PhpParser\\Node\\BetterNodeFinder\:\:find\(\) expects array<PhpParser\\Node\>\|PhpParser\\Node, array<PhpParser\\Node\\Stmt\>\|null given#'
|
||||
- '#PHPDoc tag @return with type iterable<object\> is not subtype of native type array#'
|
||||
- '#Method Rector\\SOLID\\Reflection\\ParentConstantReflectionResolver\:\:(.*?)\(\) should return ReflectionClassConstant\|null but returns ReflectionClassConstant\|false#'
|
||||
- '#Parameter \#1 \$firstStmt of method Rector\\Core\\Rector\\MethodBody\\NormalToFluentRector\:\:isBothMethodCallMatch\(\) expects PhpParser\\Node\\Stmt\\Expression, PhpParser\\Node\\Stmt given#'
|
||||
- '#Parameter \#1 \$firstStmt of method Rector\\Generic\\Rector\\MethodBody\\NormalToFluentRector\:\:isBothMethodCallMatch\(\) expects PhpParser\\Node\\Stmt\\Expression, PhpParser\\Node\\Stmt given#'
|
||||
- '#Method Rector\\Core\\Rector\\AbstractRector\:\:wrapToArg\(\) should return array<PhpParser\\Node\\Arg\> but returns array<PhpParser\\Node\\Arg\|PhpParser\\Node\\Expr\>#'
|
||||
|
||||
- '#Method Rector\\FileSystemRector\\Rector\\AbstractFileSystemRector\:\:wrapToArg\(\) should return array<PhpParser\\Node\\Arg\> but returns array<PhpParser\\Node\\Arg\|PhpParser\\Node\\Expr\>#'
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Architecture\DependencyInjection;
|
||||
namespace Rector\Generic\Rector\Architecture\DependencyInjection;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -17,7 +17,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\Symfony\ServiceMapProvider;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\ActionInjectionToConstructorInjectionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\ActionInjectionToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class ActionInjectionToConstructorInjectionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Architecture\DependencyInjection;
|
||||
namespace Rector\Generic\Rector\Architecture\DependencyInjection;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
@ -22,7 +22,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
* - http://jmsyst.com/bundles/JMSDiExtraBundle/master/annotations
|
||||
* - https://github.com/rectorphp/rector/issues/700#issue-370301169
|
||||
*
|
||||
* @see \Rector\Core\Tests\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector\AnnotatedPropertyInjectToConstructorInjectionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector\AnnotatedPropertyInjectToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class AnnotatedPropertyInjectToConstructorInjectionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Architecture\DependencyInjection;
|
||||
namespace Rector\Generic\Rector\Architecture\DependencyInjection;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\ActionInjectionToConstructorInjectionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\ActionInjectionToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class ReplaceVariableByPropertyFetchRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Architecture\Factory;
|
||||
namespace Rector\Generic\Rector\Architecture\Factory;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -19,7 +19,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Architecture\Factory\NewObjectToFactoryCreateRector\NewObjectToFactoryCreateRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Architecture\Factory\NewObjectToFactoryCreateRector\NewObjectToFactoryCreateRectorTest
|
||||
*/
|
||||
final class NewObjectToFactoryCreateRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Argument;
|
||||
namespace Rector\Generic\Rector\Argument;
|
||||
|
||||
use PhpParser\BuilderHelpers;
|
||||
use PhpParser\Node;
|
||||
@ -22,7 +22,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Argument\ArgumentAdderRector\ArgumentAdderRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Argument\ArgumentAdderRector\ArgumentAdderRectorTest
|
||||
*/
|
||||
final class ArgumentAdderRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Argument;
|
||||
namespace Rector\Generic\Rector\Argument;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\BuilderHelpers;
|
||||
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Argument\ArgumentDefaultValueReplacerRector\ArgumentDefaultValueReplacerRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Argument\ArgumentDefaultValueReplacerRector\ArgumentDefaultValueReplacerRectorTest
|
||||
*/
|
||||
final class ArgumentDefaultValueReplacerRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Argument;
|
||||
namespace Rector\Generic\Rector\Argument;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Argument\ArgumentRemoverRector\ArgumentRemoverRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Argument\ArgumentRemoverRector\ArgumentRemoverRectorTest
|
||||
*/
|
||||
final class ArgumentRemoverRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Argument;
|
||||
namespace Rector\Generic\Rector\Argument;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Argument\SwapFuncCallArgumentsRector\SwapFuncCallArgumentsRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Argument\SwapFuncCallArgumentsRector\SwapFuncCallArgumentsRectorTest
|
||||
*/
|
||||
final class SwapFuncCallArgumentsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Assign;
|
||||
namespace Rector\Generic\Rector\Assign;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Assign\PropertyAssignToMethodCallRector\PropertyAssignToMethodCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Assign\PropertyAssignToMethodCallRector\PropertyAssignToMethodCallRectorTest
|
||||
*/
|
||||
final class PropertyAssignToMethodCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\ClassLike;
|
||||
namespace Rector\Generic\Rector\ClassLike;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
@ -15,7 +15,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\ClassLike\RemoveTraitRector\RemoveTraitRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\ClassLike\RemoveTraitRector\RemoveTraitRectorTest
|
||||
*/
|
||||
final class RemoveTraitRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\ClassMethod;
|
||||
namespace Rector\Generic\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\ClassMethod\AddMethodParentCallRector\AddMethodParentCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\ClassMethod\AddMethodParentCallRector\AddMethodParentCallRectorTest
|
||||
*/
|
||||
final class AddMethodParentCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\ClassMethod;
|
||||
namespace Rector\Generic\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\ClassMethod\AddReturnTypeDeclarationRector\AddReturnTypeDeclarationRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\ClassMethod\AddReturnTypeDeclarationRector\AddReturnTypeDeclarationRectorTest
|
||||
*/
|
||||
final class AddReturnTypeDeclarationRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\ClassMethod;
|
||||
namespace Rector\Generic\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Identifier;
|
||||
@ -18,7 +18,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\ClassMethod\ChangeContractMethodSingleToManyRector\ChangeContractMethodSingleToManyRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\ClassMethod\ChangeContractMethodSingleToManyRector\ChangeContractMethodSingleToManyRectorTest
|
||||
*/
|
||||
final class ChangeContractMethodSingleToManyRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\ClassMethod;
|
||||
namespace Rector\Generic\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\ClassMethod\WrapReturnRector\WrapReturnRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\ClassMethod\WrapReturnRector\WrapReturnRectorTest
|
||||
*/
|
||||
final class WrapReturnRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Class_;
|
||||
namespace Rector\Generic\Rector\Class_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Class_\AddInterfaceByTraitRector\AddInterfaceByTraitRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Class_\AddInterfaceByTraitRector\AddInterfaceByTraitRectorTest
|
||||
*/
|
||||
final class AddInterfaceByTraitRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Class_;
|
||||
namespace Rector\Generic\Rector\Class_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
@ -15,7 +15,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
* Can handle cases like:
|
||||
* - https://doc.nette.org/en/2.4/migration-2-4#toc-nette-smartobject
|
||||
* - https://github.com/silverstripe/silverstripe-upgrader/issues/71#issue-320145944
|
||||
* @see \Rector\Core\Tests\Rector\Class_\ParentClassToTraitsRector\ParentClassToTraitsRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Class_\ParentClassToTraitsRector\ParentClassToTraitsRectorTest
|
||||
*/
|
||||
final class ParentClassToTraitsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Constant;
|
||||
namespace Rector\Generic\Rector\Constant;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
@ -12,7 +12,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Constant\RenameClassConstantsUseToStringsRector\RenameClassConstantsUseToStringsRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Constant\RenameClassConstantsUseToStringsRector\RenameClassConstantsUseToStringsRectorTest
|
||||
*/
|
||||
final class RenameClassConstantsUseToStringsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\FuncCall;
|
||||
namespace Rector\Generic\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\FuncCall\FunctionToNewRector\FunctionToNewRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\FuncCall\FunctionToNewRector\FunctionToNewRectorTest
|
||||
*/
|
||||
final class FunctionToNewRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\FuncCall;
|
||||
namespace Rector\Generic\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
/**
|
||||
* @sponsor Thanks https://twitter.com/afilina & Zenika (CAN) for sponsoring this rule - visit them on https://zenika.ca/en/en
|
||||
*
|
||||
* @see \Rector\Core\Tests\Rector\FuncCall\RemoveFuncCallArgRector\RemoveFuncCallArgRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\FuncCall\RemoveFuncCallArgRector\RemoveFuncCallArgRectorTest
|
||||
*/
|
||||
final class RemoveFuncCallArgRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\FuncCall;
|
||||
namespace Rector\Generic\Rector\FuncCall;
|
||||
|
||||
use PhpParser\Comment;
|
||||
use PhpParser\Node;
|
||||
@ -17,7 +17,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
/**
|
||||
* @sponsor Thanks https://twitter.com/afilina & Zenika (CAN) for sponsoring this rule - visit them on https://zenika.ca/en/en
|
||||
*
|
||||
* @see \Rector\Core\Tests\Rector\FuncCall\RemoveIniGetSetFuncCallRector\RemoveIniGetSetFuncCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\FuncCall\RemoveIniGetSetFuncCallRector\RemoveIniGetSetFuncCallRectorTest
|
||||
*/
|
||||
final class RemoveIniGetSetFuncCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Function_;
|
||||
namespace Rector\Generic\Rector\Function_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Function_\FunctionToMethodCallRector\FunctionToMethodCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Function_\FunctionToMethodCallRector\FunctionToMethodCallRectorTest
|
||||
*/
|
||||
final class FunctionToMethodCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Function_;
|
||||
namespace Rector\Generic\Rector\Function_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Function_\FunctionToStaticCallRector\FunctionToStaticCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Function_\FunctionToStaticCallRector\FunctionToStaticCallRectorTest
|
||||
*/
|
||||
final class FunctionToStaticCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Interface_;
|
||||
namespace Rector\Generic\Rector\Interface_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
@ -15,7 +15,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
* Covers cases like
|
||||
* - https://github.com/FriendsOfPHP/PHP-CS-Fixer/commit/a1cdb4d2dd8f45d731244eed406e1d537218cc66
|
||||
* - https://github.com/FriendsOfPHP/PHP-CS-Fixer/commit/614d2e6f7af5a5b0be5363ff536aed2b7ee5a31d
|
||||
* @see \Rector\Core\Tests\Rector\Interface_\MergeInterfacesRector\MergeInterfacesRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Interface_\MergeInterfacesRector\MergeInterfacesRectorTest
|
||||
*/
|
||||
final class MergeInterfacesRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Interface_;
|
||||
namespace Rector\Generic\Rector\Interface_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Interface_\RemoveInterfacesRector\RemoveInterfacesRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Interface_\RemoveInterfacesRector\RemoveInterfacesRectorTest
|
||||
*/
|
||||
final class RemoveInterfacesRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\MethodBody;
|
||||
namespace Rector\Generic\Rector\MethodBody;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\MethodBody\NormalToFluentRector\NormalToFluentRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodBody\NormalToFluentRector\NormalToFluentRectorTest
|
||||
*/
|
||||
final class NormalToFluentRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\MethodCall;
|
||||
namespace Rector\Generic\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -12,7 +12,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector\MethodCallToAnotherMethodCallWithArgumentsRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgumentsRector\MethodCallToAnotherMethodCallWithArgumentsRectorTest
|
||||
*/
|
||||
final class MethodCallToAnotherMethodCallWithArgumentsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\MethodCall;
|
||||
namespace Rector\Generic\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\MethodCall\MethodCallToReturnRector\MethodCallToReturnRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodCall\MethodCallToReturnRector\MethodCallToReturnRectorTest
|
||||
*/
|
||||
final class MethodCallToReturnRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\MethodCall;
|
||||
namespace Rector\Generic\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\MethodCall\MethodCallToStaticCallRector\MethodCallToStaticCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodCall\MethodCallToStaticCallRector\MethodCallToStaticCallRectorTest
|
||||
*/
|
||||
final class MethodCallToStaticCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\MethodCall;
|
||||
namespace Rector\Generic\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -18,8 +18,8 @@ use Rector\Naming\Naming\PropertyNaming;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\MethodCall\ServiceGetterToConstructorInjectionRector\ServiceGetterToConstructorInjectionRectorTest
|
||||
* @see \Rector\Core\Tests\Rector\MethodCall\ServiceGetterToConstructorInjectionRector\ServiceGetterToConstructorInjectionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodCall\ServiceGetterToConstructorInjectionRector\ServiceGetterToConstructorInjectionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\MethodCall\ServiceGetterToConstructorInjectionRector\ServiceGetterToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class ServiceGetterToConstructorInjectionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Namespace_;
|
||||
namespace Rector\Generic\Rector\Namespace_;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -24,7 +24,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\PhpDoc\PhpDocTypeRenamer;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Namespace_\PseudoNamespaceToNamespaceRector\PseudoNamespaceToNamespaceRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Namespace_\PseudoNamespaceToNamespaceRector\PseudoNamespaceToNamespaceRectorTest
|
||||
*/
|
||||
final class PseudoNamespaceToNamespaceRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\New_;
|
||||
namespace Rector\Generic\Rector\New_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\New_;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\New_\NewToStaticCallRector\NewToStaticCallRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\New_\NewToStaticCallRector\NewToStaticCallRectorTest
|
||||
*/
|
||||
final class NewToStaticCallRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Property;
|
||||
namespace Rector\Generic\Rector\Property;
|
||||
|
||||
use DI\Annotation\Inject as PHPDIInject;
|
||||
use JMS\DiExtraBundle\Annotation\Inject as JMSInject;
|
||||
@ -30,7 +30,7 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
/**
|
||||
* @see https://jmsyst.com/bundles/JMSDiExtraBundle/master/annotations#inject
|
||||
*
|
||||
* @see \Rector\Core\Tests\Rector\Property\InjectAnnotationClassRector\InjectAnnotationClassRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Property\InjectAnnotationClassRector\InjectAnnotationClassRectorTest
|
||||
*/
|
||||
final class InjectAnnotationClassRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Property;
|
||||
namespace Rector\Generic\Rector\Property;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Property\PropertyToMethodRector\PropertyToMethodRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Property\PropertyToMethodRector\PropertyToMethodRectorTest
|
||||
*/
|
||||
final class PropertyToMethodRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Property;
|
||||
namespace Rector\Generic\Rector\Property;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
@ -12,7 +12,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Property\RenamePropertyRector\RenamePropertyRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Property\RenamePropertyRector\RenamePropertyRectorTest
|
||||
*/
|
||||
final class RenamePropertyRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\StaticCall;
|
||||
namespace Rector\Generic\Rector\StaticCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\StaticCall\StaticCallToFunctionRector\StaticCallToFunctionRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\StaticCall\StaticCallToFunctionRector\StaticCallToFunctionRectorTest
|
||||
*/
|
||||
final class StaticCallToFunctionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\StaticCall;
|
||||
namespace Rector\Generic\Rector\StaticCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\StaticCall\SwapClassMethodArgumentsRector\SwapClassMethodArgumentsRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\StaticCall\SwapClassMethodArgumentsRector\SwapClassMethodArgumentsRectorTest
|
||||
*/
|
||||
final class SwapClassMethodArgumentsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\String_;
|
||||
namespace Rector\Generic\Rector\String_;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\String_\StringToClassConstantRector\StringToClassConstantRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\String_\StringToClassConstantRector\StringToClassConstantRectorTest
|
||||
*/
|
||||
final class StringToClassConstantRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Visibility;
|
||||
namespace Rector\Generic\Rector\Visibility;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassConst;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\ConfiguredCodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Visibility\ChangeConstantVisibilityRector\ChangeConstantVisibilityRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Visibility\ChangeConstantVisibilityRector\ChangeConstantVisibilityRectorTest
|
||||
*/
|
||||
final class ChangeConstantVisibilityRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Visibility;
|
||||
namespace Rector\Generic\Rector\Visibility;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
@ -12,7 +12,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Visibility\ChangeMethodVisibilityRector\ChangeMethodVisibilityRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Visibility\ChangeMethodVisibilityRector\ChangeMethodVisibilityRectorTest
|
||||
*/
|
||||
final class ChangeMethodVisibilityRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Rector\Visibility;
|
||||
namespace Rector\Generic\Rector\Visibility;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
@ -12,7 +12,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Rector\Visibility\ChangePropertyVisibilityRector\ChangePropertyVisibilityRectorTest
|
||||
* @see \Rector\Generic\Tests\Rector\Visibility\ChangePropertyVisibilityRector\ChangePropertyVisibilityRectorTest
|
||||
*/
|
||||
final class ChangePropertyVisibilityRector extends AbstractRector
|
||||
{
|
@ -2,13 +2,13 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
use Rector\Core\Rector\Architecture\DependencyInjection\ReplaceVariableByPropertyFetchRector;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Generic\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector;
|
||||
use Rector\Generic\Rector\Architecture\DependencyInjection\ReplaceVariableByPropertyFetchRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ActionInjectionToConstructorInjectionRectorTest extends AbstractRectorTestCase
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository;
|
||||
|
||||
final class SomeController
|
||||
{
|
||||
public function default(ProductRepository $productRepository)
|
||||
{
|
||||
$products = $productRepository->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository;
|
||||
|
||||
final class SomeController
|
||||
{
|
||||
private \Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository $productRepository;
|
||||
public function __construct(\Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository $productRepository)
|
||||
{
|
||||
$this->productRepository = $productRepository;
|
||||
}
|
||||
public function default()
|
||||
{
|
||||
$products = $this->productRepository->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository;
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\SomeProduct;
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\SomeRequest;
|
||||
|
||||
final class AnotherController
|
||||
{
|
||||
public function default(ProductRepository $productRepository)
|
||||
{
|
||||
$products = $productRepository->fetchAll();
|
||||
}
|
||||
public function detail(SomeRequest $request, SomeProduct $product)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository;
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\SomeProduct;
|
||||
use Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\SomeRequest;
|
||||
|
||||
final class AnotherController
|
||||
{
|
||||
private \Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository $productRepository;
|
||||
public function __construct(\Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository $productRepository)
|
||||
{
|
||||
$this->productRepository = $productRepository;
|
||||
}
|
||||
public function default()
|
||||
{
|
||||
$products = $this->productRepository->fetchAll();
|
||||
}
|
||||
public function detail(SomeRequest $request, SomeProduct $product)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source;
|
||||
|
||||
final class ProductRepository
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source;
|
||||
|
||||
final class SomeProduct
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source;
|
||||
|
||||
final class SomeRequest
|
||||
{
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
<services>
|
||||
<service id="Rector\Core\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository"></service>
|
||||
<service id="Rector\Generic\Tests\Rector\Architecture\DependencyInjection\ActionInjectionToConstructorInjectionRector\Source\ProductRepository"></service>
|
||||
</services>
|
||||
</container>
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Tests\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector;
|
||||
namespace Rector\Generic\Tests\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Generic\Rector\Architecture\DependencyInjection\AnnotatedPropertyInjectToConstructorInjectionRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class AnnotatedPropertyInjectToConstructorInjectionRectorTest extends AbstractRectorTestCase
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user