diff --git a/composer.json b/composer.json index deb7de81..5f5baffb 100644 --- a/composer.json +++ b/composer.json @@ -10,26 +10,27 @@ }, "require-dev": { "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan": "^1.10.28", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^10.3", "rector/phpstan-rules": "^0.6", "rector/rector-generator": "^0.7", "rector/rector-src": "dev-main", - "symfony/routing": "^6.1", + "symfony/routing": "^6.2", "symfony/security-core": "^6.2", "symfony/security-http": "^6.1", "symfony/validator": "^6.2", "symplify/easy-ci": "^11.2", "symplify/easy-coding-standard": "^12.0", "symplify/phpstan-extensions": "^11.1", - "symplify/phpstan-rules": "^11.2", + "symplify/phpstan-rules": "^12.0", "symplify/rule-doc-generator": "^12.0", "symplify/vendor-patches": "^11.2", "tomasvotruba/class-leak": "^0.1", "tomasvotruba/cognitive-complexity": "^0.1", "tomasvotruba/type-coverage": "^0.2", - "tomasvotruba/unused-public": "^0.2" + "tomasvotruba/unused-public": "^0.2", + "tracy/tracy": "^2.10" }, "autoload": { "psr-4": { @@ -38,8 +39,7 @@ }, "autoload-dev": { "psr-4": { - "Rector\\Symfony\\Tests\\": ["tests", "rules-tests"], - "Rector\\Symfony\\Utils\\": "utils" + "Rector\\Symfony\\Tests\\": ["tests", "rules-tests"] }, "classmap": [ "stubs" diff --git a/config/config.php b/config/config.php deleted file mode 100644 index 637d3cfd..00000000 --- a/config/config.php +++ /dev/null @@ -1,17 +0,0 @@ -services(); - - $services->defaults() - ->public() - ->autowire() - ->autoconfigure(); - - $services->load('Rector\\Symfony\\', __DIR__ . '/../src') - ->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/ValueObject']); -}; diff --git a/phpstan.neon b/phpstan.neon index 27fccb5c..061d4365 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -42,7 +42,4 @@ parameters: # false positive - '#Access to an undefined property Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts#' - '#but class PhpParser\\Node\\Stmt\\Expression is not generic#' - - '#Class "Rector\\Symfony\\CodeQuality\\Rector\\ClassMethod\\ActionSuffixRemoverRector" is missing @see annotation with test case class reference#' - '#Cognitive complexity for "Rector\\Symfony\\CodeQuality\\Rector\\Closure\\StringExtensionToConfigBuilderRector\:\:create(.*?)\(\)" is 13, keep it under 10#' - - - '#Parameter \#1 \$stmtsAware of method Rector\\Core\\NodeAnalyzer\\TerminatedNodeAnalyzer\:\:isAlwaysTerminated\(\) expects Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface, PhpParser\\Node\\Stmt\\ClassMethod given#' diff --git a/rector.php b/rector.php index 946fbc0c..ecc89da3 100644 --- a/rector.php +++ b/rector.php @@ -12,6 +12,8 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->importNames(); + $rectorConfig->removeUnusedImports(); + $rectorConfig->paths([ __DIR__ . '/config', __DIR__ . '/src', @@ -52,9 +54,6 @@ 'Symfony\Component\DependencyInjection\Container', ]); - // for testing - $rectorConfig->import(__DIR__ . '/config/config.php'); - $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_100, diff --git a/rules-tests/CodeQuality/Rector/BinaryOp/ResponseStatusCodeRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/BinaryOp/ResponseStatusCodeRector/config/configured_rule.php index 3efb4178..34438473 100644 --- a/rules-tests/CodeQuality/Rector/BinaryOp/ResponseStatusCodeRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/BinaryOp/ResponseStatusCodeRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\BinaryOp\ResponseStatusCodeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ResponseStatusCodeRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/ActionSuffixRemoverRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/ClassMethod/ActionSuffixRemoverRector/config/configured_rule.php index 7e9247f5..b91a0724 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/ActionSuffixRemoverRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/ActionSuffixRemoverRector/config/configured_rule.php @@ -4,9 +4,7 @@ use Rector\Config\RectorConfig; use Rector\Symfony\CodeQuality\Rector\ClassMethod\ActionSuffixRemoverRector; -use Rector\Symfony\Tests\ConfigList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); $rectorConfig->rule(ActionSuffixRemoverRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/ParamTypeFromRouteRequiredRegexRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/ClassMethod/ParamTypeFromRouteRequiredRegexRector/config/configured_rule.php index 9aedef2e..298917a1 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/ParamTypeFromRouteRequiredRegexRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/ParamTypeFromRouteRequiredRegexRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\ClassMethod\ParamTypeFromRouteRequiredRegexRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ParamTypeFromRouteRequiredRegexRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/RemoveUnusedRequestParamRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/ClassMethod/RemoveUnusedRequestParamRector/config/configured_rule.php index afed31b9..d8cef01a 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/RemoveUnusedRequestParamRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/RemoveUnusedRequestParamRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\ClassMethod\RemoveUnusedRequestParamRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(RemoveUnusedRequestParamRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/ResponseReturnTypeControllerActionRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/ClassMethod/ResponseReturnTypeControllerActionRector/config/configured_rule.php index b277f241..6cfab9bb 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/ResponseReturnTypeControllerActionRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/ResponseReturnTypeControllerActionRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\ClassMethod\ResponseReturnTypeControllerActionRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ResponseReturnTypeControllerActionRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/config/configured_rule.php index 316be0f7..9f4bcee6 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/TemplateAnnotationToThisRenderRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\ClassMethod\TemplateAnnotationToThisRenderRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(TemplateAnnotationToThisRenderRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector/config/config_with_parameter.php b/rules-tests/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector/config/config_with_parameter.php index 1577e9be..0716f262 100644 --- a/rules-tests/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector/config/config_with_parameter.php +++ b/rules-tests/CodeQuality/Rector/Class_/EventListenerToEventSubscriberRector/config/config_with_parameter.php @@ -6,8 +6,6 @@ use Rector\Symfony\CodeQuality\Rector\Class_\EventListenerToEventSubscriberRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - // wtf: all test have to be in single file due to autoloading race-condigition and container creating issue of fixture $rectorConfig->symfonyContainerXml(__DIR__ . '/listener_services.xml'); $rectorConfig->rule(EventListenerToEventSubscriberRector::class); diff --git a/rules-tests/CodeQuality/Rector/Class_/LoadValidatorMetadataToAnnotationRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/Class_/LoadValidatorMetadataToAnnotationRector/config/configured_rule.php index 96defd32..d7218980 100644 --- a/rules-tests/CodeQuality/Rector/Class_/LoadValidatorMetadataToAnnotationRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/Class_/LoadValidatorMetadataToAnnotationRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\Class_\LoadValidatorMetadataToAnnotationRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(LoadValidatorMetadataToAnnotationRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/Class_/MakeCommandLazyRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/Class_/MakeCommandLazyRector/config/configured_rule.php index 6e27835b..74eee29b 100644 --- a/rules-tests/CodeQuality/Rector/Class_/MakeCommandLazyRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/Class_/MakeCommandLazyRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\Class_\MakeCommandLazyRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(MakeCommandLazyRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/Closure/StringExtensionToConfigBuilderRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/Closure/StringExtensionToConfigBuilderRector/config/configured_rule.php index bfa56552..8480c6d5 100644 --- a/rules-tests/CodeQuality/Rector/Closure/StringExtensionToConfigBuilderRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/Closure/StringExtensionToConfigBuilderRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\Closure\StringExtensionToConfigBuilderRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(StringExtensionToConfigBuilderRector::class); }; diff --git a/rules-tests/CodeQuality/Rector/MethodCall/LiteralGetToRequestClassConstantRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/MethodCall/LiteralGetToRequestClassConstantRector/config/configured_rule.php index d56ab3fd..fc30a4c3 100644 --- a/rules-tests/CodeQuality/Rector/MethodCall/LiteralGetToRequestClassConstantRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/MethodCall/LiteralGetToRequestClassConstantRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\CodeQuality\Rector\MethodCall\LiteralGetToRequestClassConstantRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(LiteralGetToRequestClassConstantRector::class); }; diff --git a/rules-tests/Configs/Rector/ClassMethod/AddRouteAnnotationRector/config/configured_rule.php b/rules-tests/Configs/Rector/ClassMethod/AddRouteAnnotationRector/config/configured_rule.php index 75f5628f..2f80db70 100644 --- a/rules-tests/Configs/Rector/ClassMethod/AddRouteAnnotationRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/ClassMethod/AddRouteAnnotationRector/config/configured_rule.php @@ -3,21 +3,16 @@ declare(strict_types=1); use Rector\Config\RectorConfig; - use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface; -use Rector\Symfony\Tests\ConfigList; use Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector; use Rector\Symfony\Tests\Configs\Rector\ClassMethod\AddRouteAnnotationRector\Source\DummySymfonyRoutesProvider; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); - $rectorConfig->rule(AddRouteAnnotationRector::class); // only for tests - $services = $rectorConfig->services(); - $services->set(DummySymfonyRoutesProvider::class); + $rectorConfig->singleton(DummySymfonyRoutesProvider::class); // give this service autowiring preferences - $services->alias(SymfonyRoutesProviderInterface::class, DummySymfonyRoutesProvider::class); + $rectorConfig->alias(DummySymfonyRoutesProvider::class, SymfonyRoutesProviderInterface::class); }; diff --git a/rules-tests/Configs/Rector/Closure/ServiceArgsToServiceNamedArgRector/config/configured_rule.php b/rules-tests/Configs/Rector/Closure/ServiceArgsToServiceNamedArgRector/config/configured_rule.php index 104619fb..8ebff0b0 100644 --- a/rules-tests/Configs/Rector/Closure/ServiceArgsToServiceNamedArgRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/Closure/ServiceArgsToServiceNamedArgRector/config/configured_rule.php @@ -3,11 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Symfony\Tests\ConfigList; use Rector\Symfony\Configs\Rector\Closure\ServiceArgsToServiceNamedArgRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); $rectorConfig->rule(ServiceArgsToServiceNamedArgRector::class); }; diff --git a/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/config/configured_rule.php b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/config/configured_rule.php index f06e326c..63c99108 100644 --- a/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/config/configured_rule.php @@ -3,11 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Symfony\Tests\ConfigList; use Rector\Symfony\Configs\Rector\Closure\ServiceSetStringNameToClassNameRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); $rectorConfig->rule(ServiceSetStringNameToClassNameRector::class); $rectorConfig->symfonyContainerXml(__DIR__ . '/../xml/services.xml'); diff --git a/rules-tests/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector/config/configured_rule.php b/rules-tests/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector/config/configured_rule.php index 001ff111..24db6421 100644 --- a/rules-tests/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector/config/configured_rule.php @@ -5,10 +5,6 @@ use Rector\Config\RectorConfig; use Rector\Symfony\Configs\Rector\Closure\ServiceSettersToSettersAutodiscoveryRector; -use Rector\Symfony\Tests\ConfigList; - return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); - $rectorConfig->rule(ServiceSettersToSettersAutodiscoveryRector::class); }; diff --git a/rules-tests/Configs/Rector/Closure/ServiceTagsToDefaultsAutoconfigureRector/config/configured_rule.php b/rules-tests/Configs/Rector/Closure/ServiceTagsToDefaultsAutoconfigureRector/config/configured_rule.php index a8269ec4..1b00b154 100644 --- a/rules-tests/Configs/Rector/Closure/ServiceTagsToDefaultsAutoconfigureRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/Closure/ServiceTagsToDefaultsAutoconfigureRector/config/configured_rule.php @@ -3,11 +3,9 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Symfony\Tests\ConfigList; use Rector\Symfony\Configs\Rector\Closure\ServiceTagsToDefaultsAutoconfigureRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); $rectorConfig->rule(ServiceTagsToDefaultsAutoconfigureRector::class); }; diff --git a/rules-tests/Configs/Rector/Closure/ServicesSetNameToSetTypeRector/config/configured_rule.php b/rules-tests/Configs/Rector/Closure/ServicesSetNameToSetTypeRector/config/configured_rule.php index 8c1bcc6a..9364a543 100644 --- a/rules-tests/Configs/Rector/Closure/ServicesSetNameToSetTypeRector/config/configured_rule.php +++ b/rules-tests/Configs/Rector/Closure/ServicesSetNameToSetTypeRector/config/configured_rule.php @@ -5,10 +5,8 @@ use Rector\Config\RectorConfig; use Rector\Symfony\Configs\Rector\Closure\ServicesSetNameToSetTypeRector; -use Rector\Symfony\Tests\ConfigList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(ConfigList::MAIN); $rectorConfig->rule(ServicesSetNameToSetTypeRector::class); }; diff --git a/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/configured_rule.php b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/configured_rule.php index 81dec461..aa7ec4bb 100644 --- a/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/configured_rule.php +++ b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony25\Rector\MethodCall\MaxLengthSymfonyFormOptionToAttrRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(MaxLengthSymfonyFormOptionToAttrRector::class); }; diff --git a/rules-tests/Symfony25/Rector/MethodCall/AddViolationToBuildViolationRector/config/configured_rule.php b/rules-tests/Symfony25/Rector/MethodCall/AddViolationToBuildViolationRector/config/configured_rule.php index f991e2a6..ba04d680 100644 --- a/rules-tests/Symfony25/Rector/MethodCall/AddViolationToBuildViolationRector/config/configured_rule.php +++ b/rules-tests/Symfony25/Rector/MethodCall/AddViolationToBuildViolationRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony25\Rector\MethodCall\AddViolationToBuildViolationRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(AddViolationToBuildViolationRector::class); }; diff --git a/rules-tests/Symfony26/Rector/MethodCall/RedirectToRouteRector/config/configured_rule.php b/rules-tests/Symfony26/Rector/MethodCall/RedirectToRouteRector/config/configured_rule.php index ef5a049c..6fdf5296 100644 --- a/rules-tests/Symfony26/Rector/MethodCall/RedirectToRouteRector/config/configured_rule.php +++ b/rules-tests/Symfony26/Rector/MethodCall/RedirectToRouteRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony26\Rector\MethodCall\RedirectToRouteRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(RedirectToRouteRector::class); }; diff --git a/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/configured_rule.php b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/configured_rule.php index 2987071d..2859aae2 100644 --- a/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/configured_rule.php +++ b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony27\Rector\MethodCall\ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector::class); }; diff --git a/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/configured_rule.php b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/configured_rule.php index e35f7bf2..2a192986 100644 --- a/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/configured_rule.php +++ b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/configured_rule.php @@ -6,8 +6,6 @@ use Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->symfonyContainerXml(__DIR__ . '/../xml/services.xml'); $rectorConfig->rule(GetToConstructorInjectionRector::class); }; diff --git a/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/configured_rule.php b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/configured_rule.php index bb3a760d..e8da7b51 100644 --- a/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/configured_rule.php +++ b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony28\Rector\StaticCall\ParseFileRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ParseFileRector::class); }; diff --git a/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/configured_rule.php index 472c63cf..0a0e2a09 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony30\Rector\ClassMethod\FormTypeGetParentRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(FormTypeGetParentRector::class); }; diff --git a/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/configured_rule.php index 5b483011..e51af8ea 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony30\Rector\ClassMethod\GetRequestRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(GetRequestRector::class); }; diff --git a/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/configured_rule.php index a2819be3..d6060434 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony30\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(RemoveDefaultGetBlockPrefixRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/configured_rule.php index 88657027..39ecad13 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\ChangeStringCollectionOptionToConstantRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ChangeStringCollectionOptionToConstantRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/configured_rule.php index 76f2aa68..611c400f 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\FormTypeInstanceToClassConstRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(FormTypeInstanceToClassConstRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/configured_rule.php index f841cc8a..634eb461 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\OptionNameRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(OptionNameRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/configured_rule.php index 56c943fd..9aa5edfa 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\ReadOnlyOptionToAttributeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ReadOnlyOptionToAttributeRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/configured_rule.php b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/configured_rule.php index 8cc31226..298899d8 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/configured_rule.php +++ b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\StringFormTypeToClassRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(StringFormTypeToClassRector::class); }; diff --git a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/xml_path_config.php b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/xml_path_config.php index 52c1c3d5..494622e8 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/xml_path_config.php +++ b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/xml_path_config.php @@ -6,8 +6,6 @@ use Rector\Symfony\Symfony30\Rector\MethodCall\StringFormTypeToClassRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->symfonyContainerXml(__DIR__ . '/../Source/custom_container.xml'); $rectorConfig->rule(StringFormTypeToClassRector::class); }; diff --git a/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/configured_rule.php b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/configured_rule.php index c051ccb6..4cd9310e 100644 --- a/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/configured_rule.php +++ b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony33\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ConsoleExceptionToErrorEventConstantRector::class); }; diff --git a/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/configured_rule.php b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/configured_rule.php index ec7f7349..90074706 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/configured_rule.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony34\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(MergeMethodAnnotationToRouteAnnotationRector::class); }; diff --git a/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/configured_rule.php b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/configured_rule.php index 1da4cea3..49c579bb 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/configured_rule.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony34\Rector\ClassMethod\RemoveServiceFromSensioRouteRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(RemoveServiceFromSensioRouteRector::class); }; diff --git a/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/configured_rule.php b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/configured_rule.php index 1980f0ab..cc5fdb77 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/configured_rule.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony34\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ReplaceSensioRouteAnnotationWithSymfonyRector::class); }; diff --git a/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/configured_rule.php b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/configured_rule.php index bbc72509..fa13c102 100644 --- a/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/configured_rule.php +++ b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/configured_rule.php @@ -7,8 +7,6 @@ use Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ContainerGetNameToTypeInTestsRector::class); $rectorConfig->symfonyContainerXml(__DIR__ . '/../xml/services.xml'); diff --git a/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/configured_rule.php index 5f352a1d..b1fc0f3f 100644 --- a/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\ConstFetch\ConstraintUrlOptionRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ConstraintUrlOptionRector::class); }; diff --git a/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/configured_rule.php index b3ef46da..3b7477e5 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ContainerBuilderCompileEnvArgumentRector::class); }; diff --git a/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/configured_rule.php index d028422b..4c5fc5bb 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\MethodCall\FormIsValidRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(FormIsValidRector::class); }; diff --git a/rules-tests/Symfony40/Rector/MethodCall/ProcessBuilderGetProcessRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/MethodCall/ProcessBuilderGetProcessRector/config/configured_rule.php index 2a85ed0b..b2b98b90 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/ProcessBuilderGetProcessRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/MethodCall/ProcessBuilderGetProcessRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\MethodCall\ProcessBuilderGetProcessRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ProcessBuilderGetProcessRector::class); }; diff --git a/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/configured_rule.php index f1ce7f2c..4f3e5c94 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\MethodCall\VarDumperTestTraitMethodArgsRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(VarDumperTestTraitMethodArgsRector::class); }; diff --git a/rules-tests/Symfony40/Rector/StaticCall/ProcessBuilderInstanceRector/config/configured_rule.php b/rules-tests/Symfony40/Rector/StaticCall/ProcessBuilderInstanceRector/config/configured_rule.php index 0d464375..9889606f 100644 --- a/rules-tests/Symfony40/Rector/StaticCall/ProcessBuilderInstanceRector/config/configured_rule.php +++ b/rules-tests/Symfony40/Rector/StaticCall/ProcessBuilderInstanceRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony40\Rector\StaticCall\ProcessBuilderInstanceRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ProcessBuilderInstanceRector::class); }; diff --git a/rules-tests/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector/config/configured_rule.php b/rules-tests/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector/config/configured_rule.php index 57692293..fbdace73 100644 --- a/rules-tests/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector/config/configured_rule.php +++ b/rules-tests/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector/config/configured_rule.php @@ -6,8 +6,6 @@ use Rector\Symfony\Symfony42\Rector\MethodCall\ContainerGetToConstructorInjectionRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->symfonyContainerXml(__DIR__ . '/../xml/services.xml'); $rectorConfig->rule(ContainerGetToConstructorInjectionRector::class); }; diff --git a/rules-tests/Symfony42/Rector/New_/RootNodeTreeBuilderRector/config/configured_rule.php b/rules-tests/Symfony42/Rector/New_/RootNodeTreeBuilderRector/config/configured_rule.php index 4705921a..e6ec4f17 100644 --- a/rules-tests/Symfony42/Rector/New_/RootNodeTreeBuilderRector/config/configured_rule.php +++ b/rules-tests/Symfony42/Rector/New_/RootNodeTreeBuilderRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony42\Rector\New_\RootNodeTreeBuilderRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(RootNodeTreeBuilderRector::class); }; diff --git a/rules-tests/Symfony42/Rector/New_/StringToArrayArgumentProcessRector/config/configured_rule.php b/rules-tests/Symfony42/Rector/New_/StringToArrayArgumentProcessRector/config/configured_rule.php index 734003d6..7fa0caf8 100644 --- a/rules-tests/Symfony42/Rector/New_/StringToArrayArgumentProcessRector/config/configured_rule.php +++ b/rules-tests/Symfony42/Rector/New_/StringToArrayArgumentProcessRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony42\Rector\New_\StringToArrayArgumentProcessRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(StringToArrayArgumentProcessRector::class); }; diff --git a/rules-tests/Symfony43/Rector/ClassMethod/EventDispatcherParentConstructRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/ClassMethod/EventDispatcherParentConstructRector/config/configured_rule.php index b41c6dab..93a4e10c 100644 --- a/rules-tests/Symfony43/Rector/ClassMethod/EventDispatcherParentConstructRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/ClassMethod/EventDispatcherParentConstructRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony43\Rector\ClassMethod\EventDispatcherParentConstructRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(EventDispatcherParentConstructRector::class); }; diff --git a/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/configured_rule.php index 7c6872c8..0b3f7708 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/configured_rule.php @@ -1,13 +1,11 @@ import(ConfigList::MAIN); $rectorConfig->rule(ConvertRenderTemplateShortNotationToBundleSyntaxRector::class); }; diff --git a/rules-tests/Symfony43/Rector/MethodCall/MakeDispatchFirstArgumentEventRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/MethodCall/MakeDispatchFirstArgumentEventRector/config/configured_rule.php index dec9ff5b..c582f076 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/MakeDispatchFirstArgumentEventRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/MethodCall/MakeDispatchFirstArgumentEventRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony43\Rector\MethodCall\MakeDispatchFirstArgumentEventRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(MakeDispatchFirstArgumentEventRector::class); }; diff --git a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertIsSuccessfulRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertIsSuccessfulRector/config/configured_rule.php index e88312dd..fdb94e53 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertIsSuccessfulRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertIsSuccessfulRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony43\Rector\MethodCall\WebTestCaseAssertIsSuccessfulRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(WebTestCaseAssertIsSuccessfulRector::class); }; diff --git a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertResponseCodeRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertResponseCodeRector/config/configured_rule.php index 63eddfb0..44968612 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertResponseCodeRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertResponseCodeRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony43\Rector\MethodCall\WebTestCaseAssertResponseCodeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(WebTestCaseAssertResponseCodeRector::class); }; diff --git a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertSelectorTextContainsRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertSelectorTextContainsRector/config/configured_rule.php index fe8af315..27b66bf6 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertSelectorTextContainsRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/MethodCall/WebTestCaseAssertSelectorTextContainsRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony43\Rector\MethodCall\WebTestCaseAssertSelectorTextContainsRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(WebTestCaseAssertSelectorTextContainsRector::class); }; diff --git a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php index 85b539be..9ca0075b 100644 --- a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php +++ b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php @@ -13,6 +13,7 @@ final class TwigBundleFilesystemLoaderToTwigRectorTest extends AbstractRectorTes #[DataProvider('provideData')] public function test(string $filePath): void { + $this->doTestFile($filePath); } diff --git a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/configured_rule.php b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/configured_rule.php index 6c6a4055..bb8d9a0a 100644 --- a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/configured_rule.php +++ b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/configured_rule.php @@ -7,7 +7,5 @@ use Rector\Symfony\Symfony43\Rector\StmtsAwareInterface\TwigBundleFilesystemLoaderToTwigRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(TwigBundleFilesystemLoaderToTwigRector::class); }; diff --git a/rules-tests/Symfony44/Rector/ClassMethod/ConsoleExecuteReturnIntRector/config/configured_rule.php b/rules-tests/Symfony44/Rector/ClassMethod/ConsoleExecuteReturnIntRector/config/configured_rule.php index 1c7815d9..bba11c30 100644 --- a/rules-tests/Symfony44/Rector/ClassMethod/ConsoleExecuteReturnIntRector/config/configured_rule.php +++ b/rules-tests/Symfony44/Rector/ClassMethod/ConsoleExecuteReturnIntRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony44\Rector\ClassMethod\ConsoleExecuteReturnIntRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ConsoleExecuteReturnIntRector::class); }; diff --git a/rules-tests/Symfony44/Rector/MethodCall/AuthorizationCheckerIsGrantedExtractorRector/config/configured_rule.php b/rules-tests/Symfony44/Rector/MethodCall/AuthorizationCheckerIsGrantedExtractorRector/config/configured_rule.php index f7038dbf..55492dc9 100644 --- a/rules-tests/Symfony44/Rector/MethodCall/AuthorizationCheckerIsGrantedExtractorRector/config/configured_rule.php +++ b/rules-tests/Symfony44/Rector/MethodCall/AuthorizationCheckerIsGrantedExtractorRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony44\Rector\MethodCall\AuthorizationCheckerIsGrantedExtractorRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(AuthorizationCheckerIsGrantedExtractorRector::class); }; diff --git a/rules-tests/Symfony51/Rector/ClassMethod/CommandConstantReturnCodeRector/config/configured_rule.php b/rules-tests/Symfony51/Rector/ClassMethod/CommandConstantReturnCodeRector/config/configured_rule.php index 17358d0e..fe716ce5 100644 --- a/rules-tests/Symfony51/Rector/ClassMethod/CommandConstantReturnCodeRector/config/configured_rule.php +++ b/rules-tests/Symfony51/Rector/ClassMethod/CommandConstantReturnCodeRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony51\Rector\ClassMethod\CommandConstantReturnCodeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(CommandConstantReturnCodeRector::class); }; diff --git a/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/configured_rule.php b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/configured_rule.php index ec468158..e5834bd3 100644 --- a/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/configured_rule.php +++ b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony51\Rector\ClassMethod\RouteCollectionBuilderToRoutingConfiguratorRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(RouteCollectionBuilderToRoutingConfiguratorRector::class); }; diff --git a/rules-tests/Symfony51/Rector/Class_/LogoutHandlerToLogoutEventSubscriberRector/config/configured_rule.php b/rules-tests/Symfony51/Rector/Class_/LogoutHandlerToLogoutEventSubscriberRector/config/configured_rule.php index f402f7bb..c67523ca 100644 --- a/rules-tests/Symfony51/Rector/Class_/LogoutHandlerToLogoutEventSubscriberRector/config/configured_rule.php +++ b/rules-tests/Symfony51/Rector/Class_/LogoutHandlerToLogoutEventSubscriberRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony51\Rector\Class_\LogoutHandlerToLogoutEventSubscriberRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(LogoutHandlerToLogoutEventSubscriberRector::class); }; diff --git a/rules-tests/Symfony51/Rector/Class_/LogoutSuccessHandlerToLogoutEventSubscriberRector/config/configured_rule.php b/rules-tests/Symfony51/Rector/Class_/LogoutSuccessHandlerToLogoutEventSubscriberRector/config/configured_rule.php index ed6e1103..65de5bd1 100644 --- a/rules-tests/Symfony51/Rector/Class_/LogoutSuccessHandlerToLogoutEventSubscriberRector/config/configured_rule.php +++ b/rules-tests/Symfony51/Rector/Class_/LogoutSuccessHandlerToLogoutEventSubscriberRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony51\Rector\Class_\LogoutSuccessHandlerToLogoutEventSubscriberRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(LogoutSuccessHandlerToLogoutEventSubscriberRector::class); }; diff --git a/rules-tests/Symfony52/Rector/MethodCall/DefinitionAliasSetPrivateToSetPublicRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/MethodCall/DefinitionAliasSetPrivateToSetPublicRector/config/configured_rule.php index 97a093b9..db9fa1ec 100644 --- a/rules-tests/Symfony52/Rector/MethodCall/DefinitionAliasSetPrivateToSetPublicRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/MethodCall/DefinitionAliasSetPrivateToSetPublicRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\MethodCall\DefinitionAliasSetPrivateToSetPublicRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(DefinitionAliasSetPrivateToSetPublicRector::class); }; diff --git a/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/configured_rule.php index 6a0b8648..0bb7ef76 100644 --- a/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\MethodCall\FormBuilderSetDataMapperRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(FormBuilderSetDataMapperRector::class); }; diff --git a/rules-tests/Symfony52/Rector/MethodCall/ReflectionExtractorEnableMagicCallExtractorRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/MethodCall/ReflectionExtractorEnableMagicCallExtractorRector/config/configured_rule.php index febefa55..e8e6362e 100644 --- a/rules-tests/Symfony52/Rector/MethodCall/ReflectionExtractorEnableMagicCallExtractorRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/MethodCall/ReflectionExtractorEnableMagicCallExtractorRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\MethodCall\ReflectionExtractorEnableMagicCallExtractorRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ReflectionExtractorEnableMagicCallExtractorRector::class); }; diff --git a/rules-tests/Symfony52/Rector/MethodCall/ValidatorBuilderEnableAnnotationMappingRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/MethodCall/ValidatorBuilderEnableAnnotationMappingRector/config/configured_rule.php index f209c227..2f28681c 100644 --- a/rules-tests/Symfony52/Rector/MethodCall/ValidatorBuilderEnableAnnotationMappingRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/MethodCall/ValidatorBuilderEnableAnnotationMappingRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\MethodCall\ValidatorBuilderEnableAnnotationMappingRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(ValidatorBuilderEnableAnnotationMappingRector::class); }; diff --git a/rules-tests/Symfony52/Rector/New_/PropertyAccessorCreationBooleanToFlagsRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/New_/PropertyAccessorCreationBooleanToFlagsRector/config/configured_rule.php index 7cb4448b..0d86c1cf 100644 --- a/rules-tests/Symfony52/Rector/New_/PropertyAccessorCreationBooleanToFlagsRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/New_/PropertyAccessorCreationBooleanToFlagsRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\New_\PropertyAccessorCreationBooleanToFlagsRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(PropertyAccessorCreationBooleanToFlagsRector::class); }; diff --git a/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/configured_rule.php index 18ec5ad5..44738a17 100644 --- a/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\New_\PropertyPathMapperToDataMapperRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(PropertyPathMapperToDataMapperRector::class); }; diff --git a/rules-tests/Symfony52/Rector/StaticCall/BinaryFileResponseCreateToNewInstanceRector/config/configured_rule.php b/rules-tests/Symfony52/Rector/StaticCall/BinaryFileResponseCreateToNewInstanceRector/config/configured_rule.php index 42f720cf..8a2c895d 100644 --- a/rules-tests/Symfony52/Rector/StaticCall/BinaryFileResponseCreateToNewInstanceRector/config/configured_rule.php +++ b/rules-tests/Symfony52/Rector/StaticCall/BinaryFileResponseCreateToNewInstanceRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony52\Rector\StaticCall\BinaryFileResponseCreateToNewInstanceRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(BinaryFileResponseCreateToNewInstanceRector::class); }; diff --git a/rules-tests/Symfony53/Rector/Class_/CommandDescriptionToPropertyRector/config/configured_rule.php b/rules-tests/Symfony53/Rector/Class_/CommandDescriptionToPropertyRector/config/configured_rule.php index bca233f7..b019c120 100644 --- a/rules-tests/Symfony53/Rector/Class_/CommandDescriptionToPropertyRector/config/configured_rule.php +++ b/rules-tests/Symfony53/Rector/Class_/CommandDescriptionToPropertyRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony53\Rector\Class_\CommandDescriptionToPropertyRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(CommandDescriptionToPropertyRector::class); }; diff --git a/rules-tests/Symfony53/Rector/MethodCall/SwiftCreateMessageToNewEmailRector/config/configured_rule.php b/rules-tests/Symfony53/Rector/MethodCall/SwiftCreateMessageToNewEmailRector/config/configured_rule.php index 8162a9f7..49b71f87 100644 --- a/rules-tests/Symfony53/Rector/MethodCall/SwiftCreateMessageToNewEmailRector/config/configured_rule.php +++ b/rules-tests/Symfony53/Rector/MethodCall/SwiftCreateMessageToNewEmailRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony53\Rector\MethodCall\SwiftCreateMessageToNewEmailRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(SwiftCreateMessageToNewEmailRector::class); }; diff --git a/rules-tests/Symfony53/Rector/MethodCall/SwiftSetBodyToHtmlPlainMethodCallRector/config/configured_rule.php b/rules-tests/Symfony53/Rector/MethodCall/SwiftSetBodyToHtmlPlainMethodCallRector/config/configured_rule.php index b262e5a7..86b730ef 100644 --- a/rules-tests/Symfony53/Rector/MethodCall/SwiftSetBodyToHtmlPlainMethodCallRector/config/configured_rule.php +++ b/rules-tests/Symfony53/Rector/MethodCall/SwiftSetBodyToHtmlPlainMethodCallRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony53\Rector\MethodCall\SwiftSetBodyToHtmlPlainMethodCallRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(SwiftSetBodyToHtmlPlainMethodCallRector::class); }; diff --git a/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/configured_rule.php b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/configured_rule.php index 675c23b3..72ccaf84 100644 --- a/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/configured_rule.php +++ b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(KernelTestCaseContainerPropertyDeprecationRector::class); }; diff --git a/rules-tests/Symfony60/Rector/FuncCall/ReplaceServiceArgumentRector/config/configured_rule.php b/rules-tests/Symfony60/Rector/FuncCall/ReplaceServiceArgumentRector/config/configured_rule.php index 6a41950a..85588051 100644 --- a/rules-tests/Symfony60/Rector/FuncCall/ReplaceServiceArgumentRector/config/configured_rule.php +++ b/rules-tests/Symfony60/Rector/FuncCall/ReplaceServiceArgumentRector/config/configured_rule.php @@ -11,7 +11,6 @@ use Rector\Symfony\ValueObject\ReplaceServiceArgument; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->ruleWithConfiguration( ReplaceServiceArgumentRector::class, [new ReplaceServiceArgument(ContainerInterface::class, new String_('service_container'))] diff --git a/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/configured_rule.php b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/configured_rule.php index be0ab17b..3ab853bc 100644 --- a/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/configured_rule.php +++ b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(GetHelperControllerToServiceRector::class); }; diff --git a/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/configured_rule.php b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/configured_rule.php index 0e8fff64..9e34d07e 100644 --- a/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/configured_rule.php +++ b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony61\Rector\Class_\CommandPropertyToAttributeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(CommandPropertyToAttributeRector::class); }; diff --git a/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/configured_rule.php b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/configured_rule.php index 867ea550..928fa6cd 100644 --- a/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/configured_rule.php +++ b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony61\Rector\Class_\MagicClosureTwigExtensionToNativeMethodsRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(MagicClosureTwigExtensionToNativeMethodsRector::class); }; diff --git a/rules-tests/Symfony61/Rector/StaticPropertyFetch/ErrorNamesPropertyToConstantRector/config/configured_rule.php b/rules-tests/Symfony61/Rector/StaticPropertyFetch/ErrorNamesPropertyToConstantRector/config/configured_rule.php index 26a82748..6830db38 100644 --- a/rules-tests/Symfony61/Rector/StaticPropertyFetch/ErrorNamesPropertyToConstantRector/config/configured_rule.php +++ b/rules-tests/Symfony61/Rector/StaticPropertyFetch/ErrorNamesPropertyToConstantRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony61\Rector\StaticPropertyFetch\ErrorNamesPropertyToConstantRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ErrorNamesPropertyToConstantRector::class); }; diff --git a/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/configured_rule.php b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/configured_rule.php index 90b1b16a..9a3f18a7 100644 --- a/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/configured_rule.php +++ b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony62\Rector\ClassMethod\ParamConverterAttributeToMapEntityAttributeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(ParamConverterAttributeToMapEntityAttributeRector::class); }; diff --git a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Fixture/manual-service_messagehandler.php.inc b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Fixture/manual-service_messagehandler.php.inc index f4be3443..ab5c4152 100644 --- a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Fixture/manual-service_messagehandler.php.inc +++ b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Fixture/manual-service_messagehandler.php.inc @@ -2,9 +2,9 @@ namespace Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector\Fixture; -use App\Message\SmsNotification; +use Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector\Source\SmsNotification; -class ManualSmsNotificationHandler +final class ManualSmsNotificationHandler { public function __invoke(SmsNotification $message) { @@ -18,10 +18,10 @@ class ManualSmsNotificationHandler namespace Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector\Fixture; -use App\Message\SmsNotification; +use Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector\Source\SmsNotification; #[\Symfony\Component\Messenger\Attribute\AsMessageHandler(priority: 10, fromTransport: 'async')] -class ManualSmsNotificationHandler +final class ManualSmsNotificationHandler { public function __invoke(SmsNotification $message) { diff --git a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Source/SmsNotification.php b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Source/SmsNotification.php new file mode 100644 index 00000000..9d73710f --- /dev/null +++ b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/Source/SmsNotification.php @@ -0,0 +1,7 @@ +import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->symfonyContainerXml(__DIR__ . '/../xml/services.xml'); $rectorConfig->rule(MessageHandlerInterfaceToAttributeRector::class); diff --git a/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/configured_rule.php b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/configured_rule.php index 2d3217a4..87038cc0 100644 --- a/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/configured_rule.php +++ b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Symfony62\Rector\Class_\MessageSubscriberInterfaceToAttributeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(MessageSubscriberInterfaceToAttributeRector::class); }; diff --git a/rules-tests/Symfony62/Rector/MethodCall/SimplifyFormRenderingRector/config/configured_rule.php b/rules-tests/Symfony62/Rector/MethodCall/SimplifyFormRenderingRector/config/configured_rule.php index 5e7b484d..c1d3fb96 100644 --- a/rules-tests/Symfony62/Rector/MethodCall/SimplifyFormRenderingRector/config/configured_rule.php +++ b/rules-tests/Symfony62/Rector/MethodCall/SimplifyFormRenderingRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony62\Rector\MethodCall\SimplifyFormRenderingRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(SimplifyFormRenderingRector::class); }; diff --git a/rules-tests/Symfony63/Rector/Class_/SignalableCommandInterfaceReturnTypeRector/config/configured_rule.php b/rules-tests/Symfony63/Rector/Class_/SignalableCommandInterfaceReturnTypeRector/config/configured_rule.php index fe8bc317..3559dedf 100644 --- a/rules-tests/Symfony63/Rector/Class_/SignalableCommandInterfaceReturnTypeRector/config/configured_rule.php +++ b/rules-tests/Symfony63/Rector/Class_/SignalableCommandInterfaceReturnTypeRector/config/configured_rule.php @@ -6,7 +6,5 @@ use Rector\Symfony\Symfony63\Rector\Class_\SignalableCommandInterfaceReturnTypeRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); - $rectorConfig->rule(SignalableCommandInterfaceReturnTypeRector::class); }; diff --git a/rules-tests/Twig134/Rector/Return_/SimpleFunctionAndFilterRector/config/configured_rule.php b/rules-tests/Twig134/Rector/Return_/SimpleFunctionAndFilterRector/config/configured_rule.php index 640b3e67..13d6e607 100644 --- a/rules-tests/Twig134/Rector/Return_/SimpleFunctionAndFilterRector/config/configured_rule.php +++ b/rules-tests/Twig134/Rector/Return_/SimpleFunctionAndFilterRector/config/configured_rule.php @@ -6,6 +6,5 @@ use Rector\Symfony\Twig134\Rector\Return_\SimpleFunctionAndFilterRector; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../../../config/config.php'); $rectorConfig->rule(SimpleFunctionAndFilterRector::class); }; diff --git a/rules/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector.php b/rules/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector.php index d3626d12..ada4a9dd 100644 --- a/rules/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector.php +++ b/rules/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector.php @@ -69,8 +69,6 @@ public function getNodeTypes(): array */ public function refactor(Node $node): ?Node { - $hasChanged = false; - if (! $this->symfonyPhpClosureDetector->detect($node)) { return null; } diff --git a/rules/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector.php b/rules/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector.php index dd1cbc81..af63079f 100644 --- a/rules/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector.php +++ b/rules/Configs/Rector/Closure/ServiceSettersToSettersAutodiscoveryRector.php @@ -14,6 +14,7 @@ use PhpParser\Node\Expr\Variable; use PhpParser\Node\Name; use PhpParser\Node\Scalar\String_; +use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Expression; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Type\ObjectType; @@ -94,13 +95,13 @@ public function refactor(Node $node): ?Node return null; } - /** @var array> $bareServicesSetMethodCalls */ - $bareServicesSetMethodCalls = $this->collectServiceSetMethodCallExpressions($node); - if ($bareServicesSetMethodCalls === []) { + /** @var array> $bareServicesSetMethodCallExpressions */ + $bareServicesSetMethodCallExpressions = $this->collectServiceSetMethodCallExpressions($node); + if ($bareServicesSetMethodCallExpressions === []) { return null; } - $classNamesAndFilesPaths = $this->createClassNamesAndFilePaths($bareServicesSetMethodCalls); + $classNamesAndFilesPaths = $this->createClassNamesAndFilePaths($bareServicesSetMethodCallExpressions); $classNames = array_map( fn (ClassNameAndFilePath $classNameAndFilePath) => $classNameAndFilePath->getClassName(), @@ -117,12 +118,7 @@ public function refactor(Node $node): ?Node $loadMethodCall = $this->createServicesLoadMethodCall($sharedNamespace, $directoryConcat); $node->stmts[] = new Expression($loadMethodCall); - // remove all method calls - foreach ($bareServicesSetMethodCalls as $bareServiceSetMethodCall) { - /** @var Expression $bareServiceSetMethodCall */ - $stmtsKey = $bareServiceSetMethodCall->getAttribute(AttributeKey::STMT_KEY); - unset($node->stmts[$stmtsKey]); - } + $this->removeServicesSetMethodCalls($node, $bareServicesSetMethodCallExpressions); return $node; } @@ -233,4 +229,19 @@ private function createServicesLoadMethodCall(string $sharedNamespace, Concat $d return new MethodCall(new Variable('services'), 'load', $args); } + + /** + * @param Stmt[] $stmtsToRemove + */ + private function removeServicesSetMethodCalls(Closure $closure, array $stmtsToRemove): void + { + foreach ($closure->stmts as $key => $stmt) { + foreach ($stmtsToRemove as $bareServicesSetMethodCallExpression) { + if ($stmt === $bareServicesSetMethodCallExpression) { + unset($closure->stmts[$key]); + continue 2; + } + } + } + } } diff --git a/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php b/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php index db560d76..e11530d1 100644 --- a/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php +++ b/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php @@ -11,11 +11,11 @@ use PhpParser\Node\Expr\New_; use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt\Expression; -use PHPStan\Type\ObjectType; use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface; use Rector\Core\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; +use PHPStan\Type\ObjectType; /** * @see \Rector\Symfony\Tests\Symfony43\Rector\StmtsAwareInterface\TwigBundleFilesystemLoaderToTwigRector\TwigBundleFilesystemLoaderToTwigRectorTest @@ -108,14 +108,7 @@ private function resolveFileSystemLoaderNew(StmtsAwareInterface $stmtsAware): ?N } $new = $assign->expr; - - $newType = $this->getType($new); - if (! $newType instanceof ObjectType) { - continue; - } - - if (! $newType->isInstanceOf('Symfony\Bundle\TwigBundle\Loader\FilesystemLoader') - ->yes()) { + if (! $this->isObjectType($new, new ObjectType('Symfony\Bundle\TwigBundle\Loader\FilesystemLoader'))) { continue; } diff --git a/src/DataProvider/ServiceMapProvider.php b/src/DataProvider/ServiceMapProvider.php index 22f54652..6b1df6ea 100644 --- a/src/DataProvider/ServiceMapProvider.php +++ b/src/DataProvider/ServiceMapProvider.php @@ -22,6 +22,11 @@ public function __construct( public function provide(): ServiceMap { + // avoid caching in tests + if (defined('PHPUNIT_COMPOSER_INSTALL')) { + $this->serviceMap = null; + } + if ($this->serviceMap instanceof ServiceMap) { return $this->serviceMap; } diff --git a/stubs/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php b/stubs/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php new file mode 100644 index 00000000..79235226 --- /dev/null +++ b/stubs/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php @@ -0,0 +1,15 @@ +import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([FOSRestSetList::ANNOTATIONS_TO_ATTRIBUTES]); }; diff --git a/tests/Set/SensiolabsAnnotationsToAttributes/config/sensiolabsAnnotationsToAttributes.php b/tests/Set/SensiolabsAnnotationsToAttributes/config/sensiolabsAnnotationsToAttributes.php index 6c35b1dc..26757776 100644 --- a/tests/Set/SensiolabsAnnotationsToAttributes/config/sensiolabsAnnotationsToAttributes.php +++ b/tests/Set/SensiolabsAnnotationsToAttributes/config/sensiolabsAnnotationsToAttributes.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SensiolabsSetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES]); }; diff --git a/tests/Set/Symfony32/config/symfony32.php b/tests/Set/Symfony32/config/symfony32.php index d89930b8..94ea54cf 100644 --- a/tests/Set/Symfony32/config/symfony32.php +++ b/tests/Set/Symfony32/config/symfony32.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_32]); }; diff --git a/tests/Set/Symfony33/config/symfony33.php b/tests/Set/Symfony33/config/symfony33.php index ae9d7526..e2ef62e4 100644 --- a/tests/Set/Symfony33/config/symfony33.php +++ b/tests/Set/Symfony33/config/symfony33.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_33]); }; diff --git a/tests/Set/Symfony43/config/symfony43.php b/tests/Set/Symfony43/config/symfony43.php index 8f521df6..f44ea6b5 100644 --- a/tests/Set/Symfony43/config/symfony43.php +++ b/tests/Set/Symfony43/config/symfony43.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_43]); }; diff --git a/tests/Set/Symfony44/Fixture/event_fixture.php.inc b/tests/Set/Symfony44/Fixture/event_fixture.php.inc index dc896977..2524e594 100644 --- a/tests/Set/Symfony44/Fixture/event_fixture.php.inc +++ b/tests/Set/Symfony44/Fixture/event_fixture.php.inc @@ -1,5 +1,7 @@ import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_44]); }; diff --git a/tests/Set/Symfony50/config/symfony50.php b/tests/Set/Symfony50/config/symfony50.php index c19da848..a837545f 100644 --- a/tests/Set/Symfony50/config/symfony50.php +++ b/tests/Set/Symfony50/config/symfony50.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_50]); }; diff --git a/tests/Set/Symfony52/config/symfony52_attributes.php b/tests/Set/Symfony52/config/symfony52_attributes.php index 09e3cd33..ddf4b41e 100644 --- a/tests/Set/Symfony52/config/symfony52_attributes.php +++ b/tests/Set/Symfony52/config/symfony52_attributes.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_52]); }; diff --git a/tests/Set/Symfony60/config/symfony60.php b/tests/Set/Symfony60/config/symfony60.php index dbbe7a6e..bb553578 100644 --- a/tests/Set/Symfony60/config/symfony60.php +++ b/tests/Set/Symfony60/config/symfony60.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_60]); }; diff --git a/tests/Set/Symfony61/config/symfony61.php b/tests/Set/Symfony61/config/symfony61.php index ea029c41..b47fa36a 100644 --- a/tests/Set/Symfony61/config/symfony61.php +++ b/tests/Set/Symfony61/config/symfony61.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_61]); }; diff --git a/tests/Set/Symfony62/config/symfony62.php b/tests/Set/Symfony62/config/symfony62.php index 3e744097..f4111c2b 100644 --- a/tests/Set/Symfony62/config/symfony62.php +++ b/tests/Set/Symfony62/config/symfony62.php @@ -6,6 +6,5 @@ use Rector\Symfony\Set\SymfonySetList; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->import(__DIR__ . '/../../../../config/config.php'); $rectorConfig->sets([SymfonySetList::SYMFONY_62]); };