mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
[DX] Rename namespaces of Rector rules to respect node, instead of domain (#3911)
This commit is contained in:
parent
7a603dde2d
commit
a3be7e03ca
@ -240,7 +240,7 @@
|
||||
},
|
||||
"classmap": [
|
||||
"rules/cakephp/tests/Rector/Name/ImplicitShortClassNameUseStatementRector/Source",
|
||||
"rules/symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/Source",
|
||||
"rules/symfony/tests/Rector/MethodCall/ContainerGetToConstructorInjectionRector/Source",
|
||||
"rules/autodiscovery/tests/Rector/FileSystem/MoveInterfacesToContractNamespaceDirectoryRector/Expected",
|
||||
"rules/autodiscovery/tests/Rector/FileSystem/MoveServicesBySuffixToDirectoryRector/Expected",
|
||||
"rules/cakephp/tests/Rector/StaticCall/AppUsesStaticCallToUseStatementRector/Source",
|
||||
|
@ -3,7 +3,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\GetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\GetToConstructorInjectionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
# https://github.com/EasyCorp/EasyAdminBundle/blob/master/UPGRADE-2.0.md
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\GetParameterToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\GetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ContainerGetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\GetParameterToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\GetToConstructorInjectionRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Symfony\Rector\Controller\AddFlashRector;
|
||||
use Rector\Symfony\Rector\Controller\RedirectToRouteRector;
|
||||
use Rector\Symfony\Rector\MethodCall\AddFlashRector;
|
||||
use Rector\Symfony\Rector\MethodCall\RedirectToRouteRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -3,7 +3,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Generic\Rector\Argument\ArgumentDefaultValueReplacerRector;
|
||||
use Rector\Symfony\Rector\Yaml\ParseFileRector;
|
||||
use Rector\Symfony\Rector\StaticCall\ParseFileRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -5,16 +5,16 @@ declare(strict_types=1);
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\Constant\RenameClassConstantRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\FormTypeGetParentRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\GetRequestRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector;
|
||||
use Rector\Symfony\Rector\Form\FormTypeGetParentRector;
|
||||
use Rector\Symfony\Rector\Form\OptionNameRector;
|
||||
use Rector\Symfony\Rector\Form\StringFormTypeToClassRector;
|
||||
use Rector\Symfony\Rector\HttpKernel\GetRequestRector;
|
||||
use Rector\Symfony\Rector\MethodCall\CascadeValidationFormBuilderRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ChangeCollectionTypeOptionTypeFromStringToClassReferenceRector;
|
||||
use Rector\Symfony\Rector\MethodCall\FormTypeInstanceToClassConstRector;
|
||||
use Rector\Symfony\Rector\MethodCall\OptionNameRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ReadOnlyOptionToAttributeRector;
|
||||
use Rector\Symfony\Rector\MethodCall\StringFormTypeToClassRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
use Rector\Generic\Rector\Argument\ArgumentAdderRector;
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
use Rector\Symfony\Rector\Console\ConsoleExceptionToErrorEventConstantRector;
|
||||
use Rector\Symfony\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -3,12 +3,12 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Renaming\Rector\Class_\RenameClassRector;
|
||||
use Rector\Symfony\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector;
|
||||
use Rector\Symfony\Rector\Form\FormIsValidRector;
|
||||
use Rector\Symfony\Rector\Process\ProcessBuilderGetProcessRector;
|
||||
use Rector\Symfony\Rector\Process\ProcessBuilderInstanceRector;
|
||||
use Rector\Symfony\Rector\Validator\ConstraintUrlOptionRector;
|
||||
use Rector\Symfony\Rector\VarDumper\VarDumperTestTraitMethodArgsRector;
|
||||
use Rector\Symfony\Rector\ConstFetch\ConstraintUrlOptionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector;
|
||||
use Rector\Symfony\Rector\MethodCall\FormIsValidRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ProcessBuilderGetProcessRector;
|
||||
use Rector\Symfony\Rector\MethodCall\VarDumperTestTraitMethodArgsRector;
|
||||
use Rector\Symfony\Rector\StaticCall\ProcessBuilderInstanceRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -11,7 +11,7 @@ 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;
|
||||
use Rector\Symfony\Rector\MethodCall\ContainerGetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\New_\RootNodeTreeBuilderRector;
|
||||
use Rector\Symfony\Rector\New_\StringToArrayArgumentProcessRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Symfony\Rector\Console\ConsoleExecuteReturnIntRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\ConsoleExecuteReturnIntRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
# https://github.com/symfony/symfony/blob/4.4/UPGRADE-4.4.md
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Twig\Rector\SimpleFunctionAndFilterRector;
|
||||
use Rector\Twig\Rector\Return_\SimpleFunctionAndFilterRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
@ -12691,8 +12691,8 @@ Turn @var inline checks above code to `assert()` of hte type
|
||||
|
||||
### `ActionSuffixRemoverRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Controller\ActionSuffixRemoverRector`](/../master/rules/symfony/src/Rector/Controller/ActionSuffixRemoverRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Controller/ActionSuffixRemoverRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ClassMethod\ActionSuffixRemoverRector`](/../master/rules/symfony/src/Rector/ClassMethod/ActionSuffixRemoverRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ClassMethod/ActionSuffixRemoverRector/Fixture)
|
||||
|
||||
Removes Action suffixes from methods in Symfony Controllers
|
||||
|
||||
@ -12710,8 +12710,8 @@ Removes Action suffixes from methods in Symfony Controllers
|
||||
|
||||
### `AddFlashRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Controller\AddFlashRector`](/../master/rules/symfony/src/Rector/Controller/AddFlashRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Controller/AddFlashRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\AddFlashRector`](/../master/rules/symfony/src/Rector/MethodCall/AddFlashRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/AddFlashRector/Fixture)
|
||||
|
||||
Turns long flash adding to short helper method in Controller in Symfony
|
||||
|
||||
@ -12866,8 +12866,8 @@ return function (ContainerConfigurator $containerConfigurator) : void {
|
||||
|
||||
### `ConsoleExceptionToErrorEventConstantRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Console\ConsoleExceptionToErrorEventConstantRector`](/../master/rules/symfony/src/Rector/Console/ConsoleExceptionToErrorEventConstantRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Console/ConsoleExceptionToErrorEventConstantRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector`](/../master/rules/symfony/src/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/Fixture)
|
||||
|
||||
Turns old event name with EXCEPTION to ERROR constant in Console in Symfony
|
||||
|
||||
@ -12885,8 +12885,8 @@ Turns old event name with EXCEPTION to ERROR constant in Console in Symfony
|
||||
|
||||
### `ConsoleExecuteReturnIntRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Console\ConsoleExecuteReturnIntRector`](/../master/rules/symfony/src/Rector/Console/ConsoleExecuteReturnIntRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Console/ConsoleExecuteReturnIntRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ClassMethod\ConsoleExecuteReturnIntRector`](/../master/rules/symfony/src/Rector/ClassMethod/ConsoleExecuteReturnIntRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ClassMethod/ConsoleExecuteReturnIntRector/Fixture)
|
||||
|
||||
Returns int from Command::execute command
|
||||
|
||||
@ -12906,8 +12906,8 @@ Returns int from Command::execute command
|
||||
|
||||
### `ConstraintUrlOptionRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Validator\ConstraintUrlOptionRector`](/../master/rules/symfony/src/Rector/Validator/ConstraintUrlOptionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Validator/ConstraintUrlOptionRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ConstFetch\ConstraintUrlOptionRector`](/../master/rules/symfony/src/Rector/ConstFetch/ConstraintUrlOptionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ConstFetch/ConstraintUrlOptionRector/Fixture)
|
||||
|
||||
Turns true value to `Url::CHECK_DNS_TYPE_ANY` in Validator in Symfony.
|
||||
|
||||
@ -12920,8 +12920,8 @@ Turns true value to `Url::CHECK_DNS_TYPE_ANY` in Validator in Symfony.
|
||||
|
||||
### `ContainerBuilderCompileEnvArgumentRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector`](/../master/rules/symfony/src/Rector/DependencyInjection/ContainerBuilderCompileEnvArgumentRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/DependencyInjection/ContainerBuilderCompileEnvArgumentRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector`](/../master/rules/symfony/src/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/Fixture)
|
||||
|
||||
Turns old default value to parameter in `ContainerBuilder->build()` method in DI in Symfony
|
||||
|
||||
@ -12937,8 +12937,8 @@ Turns old default value to parameter in `ContainerBuilder->build()` method in DI
|
||||
|
||||
### `ContainerGetToConstructorInjectionRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/FrameworkBundle/ContainerGetToConstructorInjectionRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\ContainerGetToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/MethodCall/ContainerGetToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/ContainerGetToConstructorInjectionRector/Fixture)
|
||||
|
||||
Turns fetching of dependencies via `$container->get()` in ContainerAware to constructor injection in Command and Controller in Symfony
|
||||
|
||||
@ -12966,8 +12966,8 @@ Turns fetching of dependencies via `$container->get()` in ContainerAware to cons
|
||||
|
||||
### `FormIsValidRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Form\FormIsValidRector`](/../master/rules/symfony/src/Rector/Form/FormIsValidRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Form/FormIsValidRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\FormIsValidRector`](/../master/rules/symfony/src/Rector/MethodCall/FormIsValidRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/FormIsValidRector/Fixture)
|
||||
|
||||
Adds `$form->isSubmitted()` validation to all `$form->isValid()` calls in Form in Symfony
|
||||
|
||||
@ -12981,8 +12981,8 @@ Adds `$form->isSubmitted()` validation to all `$form->isValid()` calls in Form i
|
||||
|
||||
### `FormTypeGetParentRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Form\FormTypeGetParentRector`](/../master/rules/symfony/src/Rector/Form/FormTypeGetParentRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Form/FormTypeGetParentRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ClassMethod\FormTypeGetParentRector`](/../master/rules/symfony/src/Rector/ClassMethod/FormTypeGetParentRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ClassMethod/FormTypeGetParentRector/Fixture)
|
||||
|
||||
Turns string Form Type references to their `CONSTANT` alternatives in `getParent()` and `getExtendedType()` methods in Form in Symfony
|
||||
|
||||
@ -13036,8 +13036,8 @@ Changes createForm(new FormType), add(new FormType) to ones with "FormType::clas
|
||||
|
||||
### `GetParameterToConstructorInjectionRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\FrameworkBundle\GetParameterToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/FrameworkBundle/GetParameterToConstructorInjectionRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\GetParameterToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/MethodCall/GetParameterToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/GetParameterToConstructorInjectionRector/Fixture)
|
||||
|
||||
Turns fetching of parameters via `getParameter()` in ContainerAware to constructor injection in Command and Controller in Symfony
|
||||
|
||||
@ -13064,8 +13064,8 @@ Turns fetching of parameters via `getParameter()` in ContainerAware to construct
|
||||
|
||||
### `GetRequestRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\HttpKernel\GetRequestRector`](/../master/rules/symfony/src/Rector/HttpKernel/GetRequestRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/HttpKernel/GetRequestRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\ClassMethod\GetRequestRector`](/../master/rules/symfony/src/Rector/ClassMethod/GetRequestRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/ClassMethod/GetRequestRector/Fixture)
|
||||
|
||||
Turns fetching of dependencies via `$this->get()` to constructor injection in Command and Controller in Symfony
|
||||
|
||||
@ -13087,8 +13087,8 @@ Turns fetching of dependencies via `$this->get()` to constructor injection in Co
|
||||
|
||||
### `GetToConstructorInjectionRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\FrameworkBundle\GetToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/FrameworkBundle/GetToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\GetToConstructorInjectionRector`](/../master/rules/symfony/src/Rector/MethodCall/GetToConstructorInjectionRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/GetToConstructorInjectionRector/Fixture)
|
||||
|
||||
Turns fetching of dependencies via `$this->get()` to constructor injection in Command and Controller in Symfony
|
||||
|
||||
@ -13184,8 +13184,8 @@ Merge removed @Method annotation to @Route one
|
||||
|
||||
### `OptionNameRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Form\OptionNameRector`](/../master/rules/symfony/src/Rector/Form/OptionNameRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Form/OptionNameRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\OptionNameRector`](/../master/rules/symfony/src/Rector/MethodCall/OptionNameRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/OptionNameRector/Fixture)
|
||||
|
||||
Turns old option names to new ones in FormTypes in Form in Symfony
|
||||
|
||||
@ -13199,8 +13199,8 @@ Turns old option names to new ones in FormTypes in Form in Symfony
|
||||
|
||||
### `ParseFileRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Yaml\ParseFileRector`](/../master/rules/symfony/src/Rector/Yaml/ParseFileRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Yaml/ParseFileRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\StaticCall\ParseFileRector`](/../master/rules/symfony/src/Rector/StaticCall/ParseFileRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/StaticCall/ParseFileRector/Fixture)
|
||||
|
||||
session > use_strict_mode is true by default and can be removed
|
||||
|
||||
@ -13213,8 +13213,8 @@ session > use_strict_mode is true by default and can be removed
|
||||
|
||||
### `ProcessBuilderGetProcessRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Process\ProcessBuilderGetProcessRector`](/../master/rules/symfony/src/Rector/Process/ProcessBuilderGetProcessRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Process/ProcessBuilderGetProcessRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\ProcessBuilderGetProcessRector`](/../master/rules/symfony/src/Rector/MethodCall/ProcessBuilderGetProcessRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/ProcessBuilderGetProcessRector/Fixture)
|
||||
|
||||
Removes `$processBuilder->getProcess()` calls to `$processBuilder` in Process in Symfony, because ProcessBuilder was removed. This is part of multi-step Rector and has very narrow focus.
|
||||
|
||||
@ -13230,8 +13230,8 @@ Removes `$processBuilder->getProcess()` calls to `$processBuilder` in Process in
|
||||
|
||||
### `ProcessBuilderInstanceRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Process\ProcessBuilderInstanceRector`](/../master/rules/symfony/src/Rector/Process/ProcessBuilderInstanceRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Process/ProcessBuilderInstanceRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\StaticCall\ProcessBuilderInstanceRector`](/../master/rules/symfony/src/Rector/StaticCall/ProcessBuilderInstanceRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/StaticCall/ProcessBuilderInstanceRector/Fixture)
|
||||
|
||||
Turns `ProcessBuilder::instance()` to new ProcessBuilder in Process in Symfony. Part of multi-step Rector.
|
||||
|
||||
@ -13263,8 +13263,8 @@ Change "read_only" option in form to attribute
|
||||
|
||||
### `RedirectToRouteRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Controller\RedirectToRouteRector`](/../master/rules/symfony/src/Rector/Controller/RedirectToRouteRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Controller/RedirectToRouteRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\RedirectToRouteRector`](/../master/rules/symfony/src/Rector/MethodCall/RedirectToRouteRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/RedirectToRouteRector/Fixture)
|
||||
|
||||
Turns redirect to route to short helper method in Controller in Symfony
|
||||
|
||||
@ -13376,8 +13376,8 @@ Simplify use of assertions in WebTestCase
|
||||
|
||||
### `StringFormTypeToClassRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\Form\StringFormTypeToClassRector`](/../master/rules/symfony/src/Rector/Form/StringFormTypeToClassRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/Form/StringFormTypeToClassRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\StringFormTypeToClassRector`](/../master/rules/symfony/src/Rector/MethodCall/StringFormTypeToClassRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/StringFormTypeToClassRector/Fixture)
|
||||
|
||||
Turns string Form Type references to their `CONSTANT` alternatives in FormTypes in Form in Symfony. To enable custom types, add `link` to your container XML `dump` in "parameters > symfony_container_xml_path"
|
||||
|
||||
@ -13406,8 +13406,8 @@ Changes Process string argument to an array
|
||||
|
||||
### `VarDumperTestTraitMethodArgsRector`
|
||||
|
||||
- class: [`Rector\Symfony\Rector\VarDumper\VarDumperTestTraitMethodArgsRector`](/../master/rules/symfony/src/Rector/VarDumper/VarDumperTestTraitMethodArgsRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/VarDumper/VarDumperTestTraitMethodArgsRector/Fixture)
|
||||
- class: [`Rector\Symfony\Rector\MethodCall\VarDumperTestTraitMethodArgsRector`](/../master/rules/symfony/src/Rector/MethodCall/VarDumperTestTraitMethodArgsRector.php)
|
||||
- [test fixtures](/../master/rules/symfony/tests/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/Fixture)
|
||||
|
||||
Adds a new `$filter` argument in `VarDumperTestTrait->assertDumpEquals()` and `VarDumperTestTrait->assertDumpMatchesFormat()` in Validator in Symfony.
|
||||
|
||||
@ -13570,8 +13570,8 @@ return function (ContainerConfigurator $containerConfigurator) : void {
|
||||
|
||||
### `SimpleFunctionAndFilterRector`
|
||||
|
||||
- class: [`Rector\Twig\Rector\SimpleFunctionAndFilterRector`](/../master/rules/twig/src/Rector/SimpleFunctionAndFilterRector.php)
|
||||
- [test fixtures](/../master/rules/twig/tests/Rector/SimpleFunctionAndFilterRector/Fixture)
|
||||
- class: [`Rector\Twig\Rector\Return_\SimpleFunctionAndFilterRector`](/../master/rules/twig/src/Rector/Return_/SimpleFunctionAndFilterRector.php)
|
||||
- [test fixtures](/../master/rules/twig/tests/Rector/Return_/SimpleFunctionAndFilterRector/Fixture)
|
||||
|
||||
Changes Twig_Function_Method to Twig_SimpleFunction calls in Twig_Extension.
|
||||
|
||||
|
@ -20,10 +20,14 @@
|
||||
namespace Rector\DoctrineAnnotationGenerated;
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Attribute;
|
||||
use ReflectionClass;
|
||||
use Doctrine\Common\Annotations\Annotation\Enum;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use Doctrine\Common\Annotations\Annotation\Attributes;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionProperty;
|
||||
use RuntimeException;
|
||||
use stdClass;
|
||||
/**
|
||||
* A parser for docblock annotations.
|
||||
*
|
||||
@ -47,7 +51,7 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* The lexer.
|
||||
*
|
||||
* @var \Doctrine\Common\Annotations\DocLexer
|
||||
* @var DocLexer
|
||||
*/
|
||||
private $lexer;
|
||||
/**
|
||||
@ -59,7 +63,7 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* Doc parser used to collect annotation target.
|
||||
*
|
||||
* @var \Doctrine\Common\Annotations\DocParser
|
||||
* @var DocParser
|
||||
*/
|
||||
private static $metadataParser;
|
||||
/**
|
||||
@ -181,8 +185,7 @@ final class ConstantPreservingDocParser
|
||||
* @param string $namespace
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function addNamespace($namespace)
|
||||
{
|
||||
@ -197,8 +200,7 @@ final class ConstantPreservingDocParser
|
||||
* @param array $imports
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function setImports(array $imports)
|
||||
{
|
||||
@ -225,6 +227,8 @@ final class ConstantPreservingDocParser
|
||||
* @param string $context The parsing context.
|
||||
*
|
||||
* @return array Array of annotations. If no annotations are found, an empty array is returned.
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function parse($input, $context = '')
|
||||
{
|
||||
@ -241,10 +245,8 @@ final class ConstantPreservingDocParser
|
||||
* Finds the first valid annotation
|
||||
*
|
||||
* @param string $input The docblock string to parse
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
private function findInitialTokenPosition($input)
|
||||
private function findInitialTokenPosition($input): ?int
|
||||
{
|
||||
$pos = 0;
|
||||
// search for first valid annotation
|
||||
@ -262,14 +264,15 @@ final class ConstantPreservingDocParser
|
||||
* Attempts to match the given token with the current lookahead token.
|
||||
* If they match, updates the lookahead token; otherwise raises a syntax error.
|
||||
*
|
||||
* @param integer $token Type of token.
|
||||
* @param int $token Type of token.
|
||||
*
|
||||
* @return boolean True if tokens match; false otherwise.
|
||||
* @return bool True if tokens match; false otherwise.
|
||||
* @throws AnnotationException
|
||||
*/
|
||||
private function match($token)
|
||||
private function match(int $token): bool
|
||||
{
|
||||
if (!$this->lexer->isNextToken($token)) {
|
||||
$this->syntaxError($this->lexer->getLiteral($token));
|
||||
throw $this->syntaxError($this->lexer->getLiteral($token));
|
||||
}
|
||||
return $this->lexer->moveNext();
|
||||
}
|
||||
@ -279,14 +282,12 @@ final class ConstantPreservingDocParser
|
||||
* If any of them matches, this method updates the lookahead token; otherwise
|
||||
* a syntax error is raised.
|
||||
*
|
||||
* @param array $tokens
|
||||
*
|
||||
* @return boolean
|
||||
* @throws AnnotationException
|
||||
*/
|
||||
private function matchAny(array $tokens)
|
||||
private function matchAny(array $tokens): bool
|
||||
{
|
||||
if (!$this->lexer->isNextTokenAny($tokens)) {
|
||||
$this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens)));
|
||||
throw $this->syntaxError(implode(' or ', array_map([$this->lexer, 'getLiteral'], $tokens)));
|
||||
}
|
||||
return $this->lexer->moveNext();
|
||||
}
|
||||
@ -295,12 +296,8 @@ final class ConstantPreservingDocParser
|
||||
*
|
||||
* @param string $expected Expected string.
|
||||
* @param array|null $token Optional token.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws AnnotationException
|
||||
*/
|
||||
private function syntaxError($expected, $token = null)
|
||||
private function syntaxError(string $expected, ?array $token = null): \Doctrine\Common\Annotations\AnnotationException
|
||||
{
|
||||
if ($token === null) {
|
||||
$token = $this->lexer->lookahead;
|
||||
@ -311,17 +308,13 @@ final class ConstantPreservingDocParser
|
||||
$message .= ' in ' . $this->context;
|
||||
}
|
||||
$message .= '.';
|
||||
throw \Doctrine\Common\Annotations\AnnotationException::syntaxError($message);
|
||||
return \Doctrine\Common\Annotations\AnnotationException::syntaxError($message);
|
||||
}
|
||||
/**
|
||||
* Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism
|
||||
* but uses the {@link AnnotationRegistry} to load classes.
|
||||
*
|
||||
* @param string $fqcn
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private function classExists($fqcn)
|
||||
private function classExists(string $fqcn): bool
|
||||
{
|
||||
if (isset($this->classExists[$fqcn])) {
|
||||
return $this->classExists[$fqcn];
|
||||
@ -338,9 +331,10 @@ final class ConstantPreservingDocParser
|
||||
*
|
||||
* @param string $name The annotation name
|
||||
*
|
||||
* @return void
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function collectAnnotationMetadata($name)
|
||||
private function collectAnnotationMetadata(string $name): void
|
||||
{
|
||||
if (self::$metadataParser === null) {
|
||||
self::$metadataParser = new self();
|
||||
@ -406,13 +400,8 @@ final class ConstantPreservingDocParser
|
||||
}
|
||||
/**
|
||||
* Collects parsing metadata for a given attribute.
|
||||
*
|
||||
* @param array $metadata
|
||||
* @param Attribute $attribute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function collectAttributeTypeMetadata(&$metadata, \Doctrine\Common\Annotations\Annotation\Attribute $attribute)
|
||||
private function collectAttributeTypeMetadata(array &$metadata, \Doctrine\Common\Annotations\Annotation\Attribute $attribute): void
|
||||
{
|
||||
// handle internal type declaration
|
||||
$type = self::$typeMap[$attribute->type] ?? $attribute->type;
|
||||
@ -448,9 +437,10 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* Annotations ::= Annotation {[ "*" ]* [Annotation]}*
|
||||
*
|
||||
* @return array
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function Annotations()
|
||||
private function Annotations(): array
|
||||
{
|
||||
$annotations = [];
|
||||
while (null !== $this->lexer->lookahead) {
|
||||
@ -486,6 +476,7 @@ final class ConstantPreservingDocParser
|
||||
* @return mixed False if it is not a valid annotation.
|
||||
*
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function Annotation()
|
||||
{
|
||||
@ -617,9 +608,10 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* MethodCall ::= ["(" [Values] ")"]
|
||||
*
|
||||
* @return array
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function MethodCall()
|
||||
private function MethodCall(): array
|
||||
{
|
||||
$values = [];
|
||||
if (!$this->lexer->isNextToken(\Doctrine\Common\Annotations\DocLexer::T_OPEN_PARENTHESIS)) {
|
||||
@ -635,9 +627,10 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* Values ::= Array | Value {"," Value}* [","]
|
||||
*
|
||||
* @return array
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function Values()
|
||||
private function Values(): array
|
||||
{
|
||||
$values = [$this->Value()];
|
||||
while ($this->lexer->isNextToken(\Doctrine\Common\Annotations\DocLexer::T_COMMA)) {
|
||||
@ -648,7 +641,7 @@ final class ConstantPreservingDocParser
|
||||
$token = $this->lexer->lookahead;
|
||||
$value = $this->Value();
|
||||
if (!is_object($value) && !is_array($value)) {
|
||||
$this->syntaxError('Value', $token);
|
||||
throw $this->syntaxError('Value', $token);
|
||||
}
|
||||
$values[] = $value;
|
||||
}
|
||||
@ -752,13 +745,13 @@ final class ConstantPreservingDocParser
|
||||
/**
|
||||
* Identifier ::= string
|
||||
*
|
||||
* @return string
|
||||
* @throws AnnotationException
|
||||
*/
|
||||
private function Identifier()
|
||||
private function Identifier(): string
|
||||
{
|
||||
// check if we have an annotation
|
||||
if (!$this->lexer->isNextTokenAny(self::$classIdentifiers)) {
|
||||
$this->syntaxError('namespace separator or identifier');
|
||||
throw $this->syntaxError('namespace separator or identifier');
|
||||
}
|
||||
$this->lexer->moveNext();
|
||||
$className = $this->lexer->token['value'];
|
||||
@ -773,6 +766,8 @@ final class ConstantPreservingDocParser
|
||||
* Value ::= PlainValue | FieldAssignment
|
||||
*
|
||||
* @return mixed
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function Value()
|
||||
{
|
||||
@ -786,6 +781,8 @@ final class ConstantPreservingDocParser
|
||||
* PlainValue ::= integer | string | float | boolean | Array | Annotation
|
||||
*
|
||||
* @return mixed
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function PlainValue()
|
||||
{
|
||||
@ -818,16 +815,16 @@ final class ConstantPreservingDocParser
|
||||
$this->match(\Doctrine\Common\Annotations\DocLexer::T_NULL);
|
||||
return null;
|
||||
default:
|
||||
$this->syntaxError('PlainValue');
|
||||
throw $this->syntaxError('PlainValue');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* FieldAssignment ::= FieldName "=" PlainValue
|
||||
* FieldName ::= identifier
|
||||
*
|
||||
* @return \stdClass
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function FieldAssignment()
|
||||
private function FieldAssignment(): \stdClass
|
||||
{
|
||||
$this->match(\Doctrine\Common\Annotations\DocLexer::T_IDENTIFIER);
|
||||
$fieldName = $this->lexer->token['value'];
|
||||
@ -839,10 +836,10 @@ final class ConstantPreservingDocParser
|
||||
}
|
||||
/**
|
||||
* Array ::= "{" ArrayEntry {"," ArrayEntry}* [","] "}"
|
||||
*
|
||||
* @return array
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function Arrayx()
|
||||
private function Arrayx(): array
|
||||
{
|
||||
$array = $values = [];
|
||||
$this->match(\Doctrine\Common\Annotations\DocLexer::T_OPEN_CURLY_BRACES);
|
||||
@ -876,9 +873,10 @@ final class ConstantPreservingDocParser
|
||||
* KeyValuePair ::= Key ("=" | ":") PlainValue | Constant
|
||||
* Key ::= string | integer | Constant
|
||||
*
|
||||
* @return array
|
||||
* @throws AnnotationException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function ArrayEntry()
|
||||
private function ArrayEntry(): array
|
||||
{
|
||||
$peek = $this->lexer->glimpse();
|
||||
if (\Doctrine\Common\Annotations\DocLexer::T_EQUALS === $peek['type'] || \Doctrine\Common\Annotations\DocLexer::T_COLON === $peek['type']) {
|
||||
@ -895,12 +893,8 @@ final class ConstantPreservingDocParser
|
||||
}
|
||||
/**
|
||||
* Checks whether the given $name matches any ignored annotation name or namespace
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isIgnoredAnnotation($name)
|
||||
private function isIgnoredAnnotation(string $name): bool
|
||||
{
|
||||
if ($this->ignoreNotImportedAnnotations || isset($this->ignoredAnnotationNames[$name])) {
|
||||
return true;
|
||||
|
@ -216,7 +216,7 @@ parameters:
|
||||
# false positive
|
||||
- '#Comparison operation "<" between 0 and 2 is always true#'
|
||||
|
||||
- '#Method Rector\\Symfony\\Rector\\FrameworkBundle\\AbstractToConstructorInjectionRector\:\:getServiceTypeFromMethodCallArgument\(\) should return PHPStan\\Type\\Type but returns PHPStan\\Type\\Type\|null#'
|
||||
- '#Method Rector\\Symfony\\Rector\\MethodCall\\AbstractToConstructorInjectionRector\:\:getServiceTypeFromMethodCallArgument\(\) should return PHPStan\\Type\\Type but returns PHPStan\\Type\\Type\|null#'
|
||||
|
||||
- '#Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string<object\>, string given#'
|
||||
- '#Unable to resolve the template type ExpectedType in call to method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\)#'
|
||||
|
@ -28,15 +28,15 @@ use JMS\DiExtraBundle\Annotation as DI;
|
||||
class SomeController
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeEntityManager
|
||||
* @var \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeEntityManager
|
||||
*/
|
||||
private $entityManager;
|
||||
|
||||
/**
|
||||
* @var \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
* @var \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
*/
|
||||
private $translator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeEntityManager $entityManager, \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeEntityManager $entityManager, \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
$this->translator = $translator;
|
||||
|
@ -23,10 +23,10 @@ use JMS\DiExtraBundle\Annotation as DI;
|
||||
class ClassWithInjects35
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
* @var \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
*/
|
||||
private $translator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ use JMS\DiExtraBundle\Annotation as DI;
|
||||
class ClassWithPublicInjects
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
* @var \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface
|
||||
*/
|
||||
public $translator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use JMS\DiExtraBundle\Annotation as DI;
|
||||
class SomeController2
|
||||
{
|
||||
/**
|
||||
* @DI\Inject("Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeEntityManager")
|
||||
* @DI\Inject("Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeEntityManager")
|
||||
*/
|
||||
private $entityManager;
|
||||
}
|
||||
@ -23,10 +23,10 @@ use JMS\DiExtraBundle\Annotation as DI;
|
||||
class SomeController2
|
||||
{
|
||||
/**
|
||||
* @var \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeEntityManager
|
||||
* @var \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeEntityManager
|
||||
*/
|
||||
private $entityManager;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeEntityManager $entityManager)
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeEntityManager $entityManager)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ final class InjectAnnotationClassRectorTest extends AbstractRectorTestCase
|
||||
{
|
||||
$this->setParameter(
|
||||
Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER,
|
||||
__DIR__ . '/../../../../../symfony/tests/Rector/FrameworkBundle/GetToConstructorInjectionRector/xml/services.xml'
|
||||
__DIR__ . '/../../../../../symfony/tests/Rector/MethodCall/GetToConstructorInjectionRector/xml/services.xml'
|
||||
);
|
||||
|
||||
$this->doTestFileInfo($fileInfo);
|
||||
|
@ -10,7 +10,7 @@ use PhpParser\Node\Expr\PropertyFetch;
|
||||
use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\AbstractToConstructorInjectionRector;
|
||||
use Rector\Symfony\Rector\MethodCall\AbstractToConstructorInjectionRector;
|
||||
|
||||
/**
|
||||
* @sponsor Thanks https://amateri.com for sponsoring this rule - visit them on https://www.startupjobs.cz/startup/scrumworks-s-r-o
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Console;
|
||||
namespace Rector\Symfony\Rector\ClassConstFetch;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
* - https://github.com/symfony/symfony/pull/22441/files
|
||||
* - https://github.com/symfony/symfony/blob/master/UPGRADE-3.3.md#console
|
||||
*
|
||||
* @see \Rector\Symfony\Tests\Rector\Console\ConsoleExceptionToErrorEventConstantRector\ConsoleExceptionToErrorEventConstantRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector\ConsoleExceptionToErrorEventConstantRectorTest
|
||||
*/
|
||||
final class ConsoleExceptionToErrorEventConstantRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Controller;
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\Symfony\Bridge\NodeAnalyzer\ControllerMethodAnalyzer;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector\ActionSuffixRemoverRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector\ActionSuffixRemoverRectorTest
|
||||
*/
|
||||
final class ActionSuffixRemoverRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Console;
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
||||
@ -23,7 +23,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see https://github.com/symfony/symfony/pull/33775/files
|
||||
* @see \Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\ConsoleExecuteReturnIntRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\ConsoleExecuteReturnIntRectorTest
|
||||
*/
|
||||
final class ConsoleExecuteReturnIntRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Form;
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\Symfony\FormHelper\FormTypeStringToTypeProvider;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector\FormTypeGetParentRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector\FormTypeGetParentRectorTest
|
||||
*/
|
||||
final class FormTypeGetParentRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\HttpKernel;
|
||||
namespace Rector\Symfony\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -18,7 +18,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Symfony\Bridge\NodeAnalyzer\ControllerMethodAnalyzer;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\GetRequestRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\GetRequestRectorTest
|
||||
*/
|
||||
final class GetRequestRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Validator;
|
||||
namespace Rector\Symfony\Rector\ConstFetch;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ConstFetch;
|
||||
@ -14,7 +14,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* Ref: https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md#validator
|
||||
* @see \Rector\Symfony\Tests\Rector\Validator\ConstraintUrlOptionRector\ConstraintUrlOptionRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\ConstFetch\ConstraintUrlOptionRector\ConstraintUrlOptionRectorTest
|
||||
*/
|
||||
final class ConstraintUrlOptionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\FrameworkBundle;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Controller;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -16,7 +16,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Controller\AddFlashRector\AddFlashRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\AddFlashRector\AddFlashRectorTest
|
||||
*/
|
||||
final class AddFlashRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\DependencyInjection;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector\ContainerBuilderCompileEnvArgumentRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector\ContainerBuilderCompileEnvArgumentRectorTest
|
||||
*/
|
||||
final class ContainerBuilderCompileEnvArgumentRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\FrameworkBundle;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -13,7 +13,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* Ref: https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md#console
|
||||
* @see \Rector\Symfony\Tests\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector\ContainerGetToConstructorInjectionRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\ContainerGetToConstructorInjectionRector\ContainerGetToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class ContainerGetToConstructorInjectionRector extends AbstractToConstructorInjectionRector implements ConfigurableRectorInterface
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Form;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
|
||||
@ -15,7 +15,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Form\FormIsValidRector\FormIsValidRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\FormIsValidRector\FormIsValidRectorTest
|
||||
*/
|
||||
final class FormIsValidRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\FrameworkBundle;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -17,7 +17,7 @@ use Rector\Naming\Naming\PropertyNaming;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\FrameworkBundle\GetParameterToConstructorInjectionRector\GetParameterToConstructorInjectionRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\GetParameterToConstructorInjectionRector\GetParameterToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class GetParameterToConstructorInjectionRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\FrameworkBundle;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\GetToConstructorInjectionRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\GetToConstructorInjectionRector\GetToConstructorInjectionRectorTest
|
||||
*/
|
||||
final class GetToConstructorInjectionRector extends AbstractToConstructorInjectionRector implements ConfigurableRectorInterface
|
||||
{
|
@ -2,17 +2,16 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Form;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\Symfony\Rector\MethodCall\AbstractFormAddRector;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Form\OptionNameRector\OptionNameRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\OptionNameRector\OptionNameRectorTest
|
||||
*/
|
||||
final class OptionNameRector extends AbstractFormAddRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Process;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -11,7 +11,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Process\ProcessBuilderGetProcessRector\ProcessBuilderGetProcessRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\ProcessBuilderGetProcessRector\ProcessBuilderGetProcessRectorTest
|
||||
*/
|
||||
final class ProcessBuilderGetProcessRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Controller;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -13,7 +13,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Controller\RedirectToRouteRector\RedirectToRouteRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\RedirectToRouteRector\RedirectToRouteRectorTest
|
||||
*/
|
||||
final class RedirectToRouteRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Form;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
@ -10,12 +10,11 @@ use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\Symfony\Rector\MethodCall\AbstractFormAddRector;
|
||||
|
||||
/**
|
||||
* Covers https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form
|
||||
*
|
||||
* @see \Rector\Symfony\Tests\Rector\Form\StringFormTypeToClassRector\StringFormTypeToClassRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\StringFormTypeToClassRector\StringFormTypeToClassRectorTest
|
||||
*/
|
||||
final class StringFormTypeToClassRector extends AbstractFormAddRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\VarDumper;
|
||||
namespace Rector\Symfony\Rector\MethodCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ConstFetch;
|
||||
@ -13,7 +13,7 @@ use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\VarDumper\VarDumperTestTraitMethodArgsRector\VarDumperTestTraitMethodArgsRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\MethodCall\VarDumperTestTraitMethodArgsRector\VarDumperTestTraitMethodArgsRectorTest
|
||||
*/
|
||||
final class VarDumperTestTraitMethodArgsRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Yaml;
|
||||
namespace Rector\Symfony\Rector\StaticCall;
|
||||
|
||||
use Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
@ -16,7 +16,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Yaml\ParseFileRector\ParseFileRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\StaticCall\ParseFileRector\ParseFileRectorTest
|
||||
*/
|
||||
final class ParseFileRector extends AbstractRector
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Rector\Process;
|
||||
namespace Rector\Symfony\Rector\StaticCall;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\New_;
|
||||
@ -14,7 +14,7 @@ use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
use Symfony\Component\Process\ProcessBuilder;
|
||||
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Rector\Process\ProcessBuilderInstanceRector\ProcessBuilderInstanceRectorTest
|
||||
* @see \Rector\Symfony\Tests\Rector\StaticCall\ProcessBuilderInstanceRector\ProcessBuilderInstanceRectorTest
|
||||
*/
|
||||
final class ProcessBuilderInstanceRector extends AbstractRector
|
||||
{
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExceptionToErrorEventConstantRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Console\ConsoleExceptionToErrorEventConstantRector;
|
||||
use Rector\Symfony\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ConsoleExceptionToErrorEventConstantRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExceptionToErrorEventConstantRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector\Fixture;
|
||||
|
||||
final class SomeSubscriber
|
||||
{
|
||||
@ -17,7 +17,7 @@ final class SomeSubscriber
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExceptionToErrorEventConstantRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector\Fixture;
|
||||
|
||||
final class SomeSubscriber
|
||||
{
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Controller\ActionSuffixRemoverRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\ActionSuffixRemoverRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ActionSuffixRemoverRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
||||
@ -15,7 +15,7 @@ class AppController extends SymfonyController
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\AbstractSymfonyController;
|
||||
|
||||
@ -15,7 +15,7 @@ class AppController2 extends AbstractSymfonyController
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\ActionSuffixRemoverRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ActionSuffixRemoverRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\AbstractSymfonyController;
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Console\ConsoleExecuteReturnIntRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\ConsoleExecuteReturnIntRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ConsoleExecuteReturnIntRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -18,7 +18,7 @@ final class AddReturnTypeCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -24,7 +24,7 @@ final class CoalesceCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -18,7 +18,7 @@ final class EmptyReturnCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -19,7 +19,7 @@ final class ExplicitReturnNullCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -20,7 +20,7 @@ class ACommand extends Command {}
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -24,7 +24,7 @@ final class MultipleReturnCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -18,7 +18,7 @@ final class NoReturnCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -23,7 +23,7 @@ final class ReturnFunctionCallCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
@ -23,7 +23,7 @@ final class ReturnStaticFunctionCallCommand extends Command
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Console\ConsoleExecuteReturnIntRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\ConsoleExecuteReturnIntRector\Fixture;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector\Fixture;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
||||
@ -21,7 +21,7 @@ class PermissionCollectionType extends AbstractType
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector\Fixture;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector\Fixture;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
|
||||
@ -16,7 +16,7 @@ class TypeExtension extends AbstractTypeExtension
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector\Fixture;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\FormTypeGetParentRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\FormTypeGetParentRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Form\FormTypeGetParentRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\FormTypeGetParentRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class FormTypeGetParentRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php declare (strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
||||
@ -16,7 +16,7 @@ class ClassWithNamedService extends SymfonyController
|
||||
-----
|
||||
<?php declare (strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
use Symfony\TestCase\Request;
|
||||
@ -17,7 +17,7 @@ class ClassWithParameterPresent extends SymfonyController
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
use Symfony\TestCase\Request;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\AbstractSymfonyController;
|
||||
|
||||
@ -16,7 +16,7 @@ class SomeController extends AbstractSymfonyController
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\Source\AbstractSymfonyController;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare (strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector\Fixture;
|
||||
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\HttpKernel\GetRequestRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ClassMethod\GetRequestRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\HttpKernel\GetRequestRector;
|
||||
use Rector\Symfony\Rector\ClassMethod\GetRequestRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class GetRequestRectorTest extends AbstractRectorTestCase
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Validator\ConstraintUrlOptionRector;
|
||||
namespace Rector\Symfony\Tests\Rector\ConstFetch\ConstraintUrlOptionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Validator\ConstraintUrlOptionRector;
|
||||
use Rector\Symfony\Rector\ConstFetch\ConstraintUrlOptionRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ConstraintUrlOptionRectorTest extends AbstractRectorTestCase
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Form\OptionNameRector\Source;
|
||||
|
||||
abstract class AbstractType
|
||||
{
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
final class SomeEntityManager
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
final class SomeNonKernelClass
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
interface SomeTranslatorInterface
|
||||
{
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class FirstClass extends ContainerAwareParentClass
|
||||
{
|
||||
protected function execute()
|
||||
{
|
||||
$someService = $this->getContainer()->get('translator');
|
||||
|
||||
$someService = $this->getContainer()->get('translator')->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class FirstClass extends ContainerAwareParentClass
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
}
|
||||
protected function execute()
|
||||
{
|
||||
$someService = $this->someTranslator;
|
||||
|
||||
$someService = $this->someTranslator->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
|
||||
final class ParentClassWithInConstructCall extends ThisClassCallsMethodInConstructor
|
||||
{
|
||||
protected function doSomethingFancy()
|
||||
{
|
||||
$someService = $this->getContainer()->get('translator');
|
||||
|
||||
$translatedString = $this->getContainer()->get('translator')->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
|
||||
final class ParentClassWithInConstructCall extends ThisClassCallsMethodInConstructor
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
parent::__construct();
|
||||
}
|
||||
protected function doSomethingFancy()
|
||||
{
|
||||
$someService = $this->someTranslator;
|
||||
|
||||
$translatedString = $this->someTranslator->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,7 +0,0 @@
|
||||
parameters:
|
||||
kernel_class: 'Rector\Symfony\Tests\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeKernelClass'
|
||||
|
||||
services:
|
||||
Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector:
|
||||
$containerAwareParentTypes:
|
||||
- 'Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass'
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetParameterToConstructorInjectionRector\Source;
|
||||
|
||||
final class DoctrineQuery
|
||||
{
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Anything;
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
||||
class ClassWithNamedService2 extends SymfonyController
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$this->renderTwig([
|
||||
'posts' => $this->get(\Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Something::class)->callMe(),
|
||||
'comments' => $this->get(Anything::class)->callMe(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Anything;
|
||||
use Rector\Symfony\Tests\Rector\Source\SymfonyController;
|
||||
|
||||
class ClassWithNamedService2 extends SymfonyController
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Something $something;
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Anything $anything;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Something $something, \Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\Anything $anything)
|
||||
{
|
||||
$this->something = $something;
|
||||
$this->anything = $anything;
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
$this->renderTwig([
|
||||
'posts' => $this->something->callMe(),
|
||||
'comments' => $this->anything->callMe(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\GetTrait;
|
||||
|
||||
class ClassWithNamedServiceAndTrait
|
||||
{
|
||||
use GetTrait;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->get('translator');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\GetTrait;
|
||||
|
||||
class ClassWithNamedServiceAndTrait
|
||||
{
|
||||
use GetTrait;
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->someTranslator;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\ParentClassWithGetTrait;
|
||||
|
||||
class ClassWithNamedServiceAndParentTrait extends ParentClassWithGetTrait
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$this->get('translator');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source\ParentClassWithGetTrait;
|
||||
|
||||
class ClassWithNamedServiceAndParentTrait extends ParentClassWithGetTrait
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
$this->someTranslator;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source;
|
||||
|
||||
final class Anything
|
||||
{
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source;
|
||||
|
||||
class ParentClassWithGetTrait
|
||||
{
|
||||
use GetTrait;
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\GetToConstructorInjectionRector\Source;
|
||||
|
||||
final class Something
|
||||
{
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
final class SomeEntityManager
|
||||
{
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
final class SomeNonKernelClass
|
||||
{
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\AbstractToConstructorInjectionRectorSource;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
final class SomeTranslator implements SomeTranslatorInterface
|
||||
{
|
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource;
|
||||
|
||||
interface SomeTranslatorInterface
|
||||
{
|
||||
}
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\AddFlashRector;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AddFlashRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\Controller\AddFlashRector;
|
||||
use Rector\Symfony\Rector\MethodCall\AddFlashRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class AddFlashRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\AddFlashRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AddFlashRector\Fixture;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -17,7 +17,7 @@ class AppController extends Controller
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\AddFlashRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AddFlashRector\Fixture;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\Controller\AddFlashRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\AddFlashRector\Fixture;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector;
|
||||
use Rector\Symfony\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ContainerBuilderCompileEnvArgumentRectorTest extends AbstractRectorTestCase
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector\Fixture;
|
||||
|
||||
function containerBuilderCompilerEnvArgument()
|
||||
{
|
||||
@ -12,7 +12,7 @@ function containerBuilderCompilerEnvArgument()
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\DependencyInjection\ContainerBuilderCompileEnvArgumentRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector\Fixture;
|
||||
|
||||
function containerBuilderCompilerEnvArgument()
|
||||
{
|
@ -2,15 +2,15 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector;
|
||||
namespace Rector\Symfony\Tests\Rector\MethodCall\ContainerGetToConstructorInjectionRector;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Rector\Symfony\Rector\FrameworkBundle\ContainerGetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
use Rector\Symfony\Rector\MethodCall\ContainerGetToConstructorInjectionRector;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
final class ContainerGetToConstructorInjectionRectorTest extends AbstractRectorTestCase
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class FirstClass extends ContainerAwareParentClass
|
||||
{
|
||||
protected function execute()
|
||||
{
|
||||
$someService = $this->getContainer()->get('translator');
|
||||
|
||||
$someService = $this->getContainer()->get('translator')->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class FirstClass extends ContainerAwareParentClass
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
}
|
||||
protected function execute()
|
||||
{
|
||||
$someService = $this->someTranslator;
|
||||
|
||||
$someService = $this->someTranslator->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
@ -18,9 +18,9 @@ final class MyCommand extends ContainerAwareParentCommand
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentCommand;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
|
||||
final class ParentClassWithInConstructCall extends ThisClassCallsMethodInConstructor
|
||||
{
|
||||
protected function doSomethingFancy()
|
||||
{
|
||||
$someService = $this->getContainer()->get('translator');
|
||||
|
||||
$translatedString = $this->getContainer()->get('translator')->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Fixture;
|
||||
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ThisClassCallsMethodInConstructor;
|
||||
|
||||
final class ParentClassWithInConstructCall extends ThisClassCallsMethodInConstructor
|
||||
{
|
||||
private \Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator;
|
||||
public function __construct(\Rector\Symfony\Tests\Rector\MethodCall\AbstractToConstructorInjectionRectorSource\SomeTranslatorInterface $someTranslator)
|
||||
{
|
||||
$this->someTranslator = $someTranslator;
|
||||
parent::__construct();
|
||||
}
|
||||
protected function doSomethingFancy()
|
||||
{
|
||||
$someService = $this->someTranslator;
|
||||
|
||||
$translatedString = $this->someTranslator->translateSomething();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class SomeController extends ContainerAwareParentClass
|
||||
{
|
||||
@ -14,7 +14,7 @@ final class SomeController extends ContainerAwareParentClass
|
||||
-----
|
||||
<?php
|
||||
|
||||
use Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
use Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source\ContainerAwareParentClass;
|
||||
|
||||
final class SomeController extends ContainerAwareParentClass
|
||||
{
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source;
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Symfony\Tests\FrameworkBundle\ContainerGetToConstructorInjectionRector\Source;
|
||||
namespace Rector\Symfony\Tests\MethodCall\ContainerGetToConstructorInjectionRector\Source;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
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