diff --git a/README.md b/README.md index b1f147a193b..2f504a23a17 100644 --- a/README.md +++ b/README.md @@ -76,19 +76,19 @@ vendor/bin/rector init And modify it: ```php -// rector.php use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (RectorConfig $rectorConfig): void { // here we can define, what sets of rules will be applied // tip: use "SetList" class to autocomplete sets - $containerConfigurator->import(SetList::CODE_QUALITY); + $rectorConfig->sets([ + SetList::CODE_QUALITY + ]); // register single rule - $services = $containerConfigurator->services(); - $services->set(TypedPropertyRector::class); + $rectorConfig->rule(TypedPropertyRector::class); }; ``` @@ -116,19 +116,18 @@ vendor/bin/rector process src // rector.php use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; - -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +use Rector\Config\RectorConfig; +return static function (RectorConfig $rectorConfig): void { // paths to refactor; solid alternative to CLI arguments - $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']); + $rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']); // is your PHP version different from the one you refactor to? [default: your PHP version], uses PHP_VERSION_ID format + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_72); // Path to PHPStan with extensions, that PHPStan in Rector uses to determine types - $parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, getcwd() . '/phpstan-for-config.neon'); + $rectorConfig->phpstanConfig(__DIR__ . '/phpstan-for-config.neon'); }; ``` diff --git a/config/config.php b/config/config.php index c9ee95571b6..7f9f44277f3 100644 --- a/config/config.php +++ b/config/config.php @@ -3,18 +3,18 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Bootstrap\ExtensionConfigResolver; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(__DIR__ . '/services.php'); - $containerConfigurator->import(__DIR__ . '/services-rules.php'); - $containerConfigurator->import(__DIR__ . '/services-packages.php'); - $containerConfigurator->import(__DIR__ . '/parameters.php'); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(__DIR__ . '/services.php'); + $rectorConfig->import(__DIR__ . '/services-rules.php'); + $rectorConfig->import(__DIR__ . '/services-packages.php'); + $rectorConfig->import(__DIR__ . '/parameters.php'); $extensionConfigResolver = new \Rector\Core\Bootstrap\ExtensionConfigResolver(); $extensionConfigFiles = $extensionConfigResolver->provide(); foreach ($extensionConfigFiles as $extensionConfigFile) { - $containerConfigurator->import($extensionConfigFile->getRealPath()); + $rectorConfig->import($extensionConfigFile->getRealPath()); } // require only in dev - $containerConfigurator->import(__DIR__ . '/../utils/compiler/config/config.php', null, 'not_found'); + $rectorConfig->import(__DIR__ . '/../utils/compiler/config/config.php', null, 'not_found'); }; diff --git a/config/parameters.php b/config/parameters.php index e3308c70f22..d10a8c919d2 100644 --- a/config/parameters.php +++ b/config/parameters.php @@ -5,10 +5,10 @@ namespace RectorPrefix20220412; use RectorPrefix20220412\OndraM\CiDetector\CiDetector; use Rector\Caching\ValueObject\Storage\MemoryCacheStorage; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); // paths and extensions $parameters->set(\Rector\Core\Configuration\Option::PATHS, []); $parameters->set(\Rector\Core\Configuration\Option::FILE_EXTENSIONS, ['php']); diff --git a/config/services-packages.php b/config/services-packages.php index 582cc311018..accd1888360 100644 --- a/config/services-packages.php +++ b/config/services-packages.php @@ -3,13 +3,13 @@ declare (strict_types=1); namespace RectorPrefix20220412; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; use RectorPrefix20220412\Symplify\EasyParallel\ValueObject\EasyParallelConfig; use RectorPrefix20220412\Symplify\PackageBuilder\Yaml\ParametersMerger; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { // make use of https://github.com/symplify/easy-parallel - $containerConfigurator->import(\RectorPrefix20220412\Symplify\EasyParallel\ValueObject\EasyParallelConfig::FILE_PATH); - $services = $containerConfigurator->services(); + $rectorConfig->import(\RectorPrefix20220412\Symplify\EasyParallel\ValueObject\EasyParallelConfig::FILE_PATH); + $services = $rectorConfig->services(); $services->defaults()->public()->autowire()->autoconfigure(); $services->load('Rector\\', __DIR__ . '/../packages')->exclude([ __DIR__ . '/../packages/Config/RectorConfig.php', diff --git a/config/services-rules.php b/config/services-rules.php index 56afe2a8cd3..0f4ca2c4ee4 100644 --- a/config/services-rules.php +++ b/config/services-rules.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\PSR4\Composer\PSR4NamespaceMatcher; use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->defaults()->public()->autowire()->autoconfigure(); // psr-4 $services->alias(\Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface::class, \Rector\PSR4\Composer\PSR4NamespaceMatcher::class); diff --git a/config/services.php b/config/services.php index c7fb200309b..2a9d102c985 100644 --- a/config/services.php +++ b/config/services.php @@ -28,6 +28,7 @@ use Rector\BetterPhpDocParser\PhpDocParser\BetterPhpDocParser; use Rector\BetterPhpDocParser\PhpDocParser\BetterTypeParser; use Rector\Caching\Cache; use Rector\Caching\CacheFactory; +use Rector\Config\RectorConfig; use Rector\Core\Console\ConsoleApplication; use Rector\Core\Console\Style\RectorConsoleOutputStyle; use Rector\Core\Console\Style\RectorConsoleOutputStyleFactory; @@ -36,7 +37,6 @@ use Rector\NodeTypeResolver\DependencyInjection\PHPStanServicesFactory; use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocator\IntermediateSourceLocator; use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider; use RectorPrefix20220412\Symfony\Component\Console\Application; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use function RectorPrefix20220412\Symfony\Component\DependencyInjection\Loader\Configurator\service; use RectorPrefix20220412\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser; use RectorPrefix20220412\Symplify\PackageBuilder\Console\Command\CommandNaming; @@ -50,8 +50,8 @@ use RectorPrefix20220412\Symplify\SmartFileSystem\FileSystemGuard; use RectorPrefix20220412\Symplify\SmartFileSystem\Finder\FinderSanitizer; use RectorPrefix20220412\Symplify\SmartFileSystem\Json\JsonFileSystem; use RectorPrefix20220412\Symplify\SmartFileSystem\SmartFileSystem; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->defaults()->public()->autowire()->autoconfigure(); $services->load('Rector\\Core\\', __DIR__ . '/../src')->exclude([__DIR__ . '/../src/Rector', __DIR__ . '/../src/Console/Style/RectorConsoleOutputStyle.php', __DIR__ . '/../src/Exception', __DIR__ . '/../src/DependencyInjection/CompilerPass', __DIR__ . '/../src/DependencyInjection/Loader', __DIR__ . '/../src/Kernel', __DIR__ . '/../src/ValueObject', __DIR__ . '/../src/Bootstrap', __DIR__ . '/../src/Enum', __DIR__ . '/../src/PhpParser/Node/CustomNode', __DIR__ . '/../src/PhpParser/ValueObject', __DIR__ . '/../src/functions', __DIR__ . '/../src/constants.php']); $services->alias(\RectorPrefix20220412\Symfony\Component\Console\Application::class, \Rector\Core\Console\ConsoleApplication::class); diff --git a/config/set/action-injection-to-constructor-injection.php b/config/set/action-injection-to-constructor-injection.php index 89d07b1ebf7..2d2064b6947 100644 --- a/config/set/action-injection-to-constructor-injection.php +++ b/config/set/action-injection-to-constructor-injection.php @@ -3,9 +3,9 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\DependencyInjection\Rector\Class_\ActionInjectionToConstructorInjectionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\DependencyInjection\Rector\Class_\ActionInjectionToConstructorInjectionRector::class); }; diff --git a/config/set/code-quality.php b/config/set/code-quality.php index 4316eef9100..c3ad2fa9701 100644 --- a/config/set/code-quality.php +++ b/config/set/code-quality.php @@ -74,12 +74,12 @@ use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector; use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector; use Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; +use Rector\Config\RectorConfig; use Rector\Php52\Rector\Property\VarToPublicPropertyRector; use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\CodeQuality\Rector\Assign\CombinedAssignRector::class); $services->set(\Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector::class); $services->set(\Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector::class); diff --git a/config/set/coding-style.php b/config/set/coding-style.php index da6b3df1b58..5b8254cf484 100644 --- a/config/set/coding-style.php +++ b/config/set/coding-style.php @@ -29,11 +29,11 @@ use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector; use Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector; use Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector; use Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector; +use Rector\Config\RectorConfig; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\CodingStyle\Rector\Assign\PHPStormVarAnnotationRector::class); $services->set(\Rector\CodingStyle\Rector\If_\NullableCompareToNullRector::class); $services->set(\Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector::class); diff --git a/config/set/dead-code.php b/config/set/dead-code.php index 3cd80878fb9..df406b52d8b 100644 --- a/config/set/dead-code.php +++ b/config/set/dead-code.php @@ -4,6 +4,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector; +use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\Array_\RemoveDuplicatedArrayKeyRector; use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector; use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector; @@ -49,9 +50,8 @@ use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector; use Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector; use Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector; use Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector::class); $services->set(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector::class); $services->set(\Rector\DeadCode\Rector\Cast\RecastingRemovalRector::class); diff --git a/config/set/defluent.php b/config/set/defluent.php index ee87adea3c8..691169ae86b 100644 --- a/config/set/defluent.php +++ b/config/set/defluent.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; // @see https://ocramius.github.io/blog/fluent-interfaces-are-evil/ // @see https://www.yegor256.com/2018/03/13/fluent-interfaces.html -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $deprecatedMessage = \sprintf('The DEFLUENT set is deprecated for high number of assumptions and reported bugs. Better use PHPStan rule "%s" to warn about these cases and refactor manually.', 'https://github.com/symplify/phpstan-rules/blob/main/docs/rules_overview.md#nochainmethodcallrule'); \trigger_error($deprecatedMessage); \sleep(3); diff --git a/config/set/downgrade-php53.php b/config/set/downgrade-php53.php index e304b4ddef7..a2d13313c1d 100644 --- a/config/set/downgrade-php53.php +++ b/config/set/downgrade-php53.php @@ -3,13 +3,13 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp53\Rector\Dir\DirConstToFileConstRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_52); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp53\Rector\Dir\DirConstToFileConstRector::class); }; diff --git a/config/set/downgrade-php54.php b/config/set/downgrade-php54.php index 957cabce08c..80980cbfdce 100644 --- a/config/set/downgrade-php54.php +++ b/config/set/downgrade-php54.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp54\Rector\Array_\ShortArrayToLongArrayRector; @@ -12,11 +13,10 @@ use Rector\DowngradePhp54\Rector\FuncCall\DowngradeIndirectCallByArrayRector; use Rector\DowngradePhp54\Rector\FunctionLike\DowngradeCallableTypeDeclarationRector; use Rector\DowngradePhp54\Rector\LNumber\DowngradeBinaryNotationRector; use Rector\DowngradePhp54\Rector\MethodCall\DowngradeInstanceMethodCallRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_53); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp54\Rector\Array_\ShortArrayToLongArrayRector::class); $services->set(\Rector\DowngradePhp54\Rector\Closure\DowngradeStaticClosureRector::class); $services->set(\Rector\DowngradePhp54\Rector\FuncCall\DowngradeIndirectCallByArrayRector::class); diff --git a/config/set/downgrade-php55.php b/config/set/downgrade-php55.php index a2e9329e8a0..83f831e29b6 100644 --- a/config/set/downgrade-php55.php +++ b/config/set/downgrade-php55.php @@ -3,17 +3,17 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp55\Rector\ClassConstFetch\DowngradeClassConstantToStringRector; use Rector\DowngradePhp55\Rector\Foreach_\DowngradeForeachListRector; use Rector\DowngradePhp55\Rector\FuncCall\DowngradeBoolvalRector; use Rector\DowngradePhp55\Rector\Isset_\DowngradeArbitraryExpressionArgsToEmptyAndIssetRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_54); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp55\Rector\ClassConstFetch\DowngradeClassConstantToStringRector::class); $services->set(\Rector\DowngradePhp55\Rector\Foreach_\DowngradeForeachListRector::class); $services->set(\Rector\DowngradePhp55\Rector\FuncCall\DowngradeBoolvalRector::class); diff --git a/config/set/downgrade-php56.php b/config/set/downgrade-php56.php index f58fb675abd..9f5c93280a7 100644 --- a/config/set/downgrade-php56.php +++ b/config/set/downgrade-php56.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp56\Rector\CallLike\DowngradeArgumentUnpackingRector; @@ -10,11 +11,10 @@ use Rector\DowngradePhp56\Rector\FuncCall\DowngradeArrayFilterUseConstantRector; use Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialAssignmentOperatorRector; use Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialOperatorRector; use Rector\DowngradePhp56\Rector\Use_\DowngradeUseFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_55); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp56\Rector\CallLike\DowngradeArgumentUnpackingRector::class); $services->set(\Rector\DowngradePhp56\Rector\Use_\DowngradeUseFunctionRector::class); $services->set(\Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialAssignmentOperatorRector::class); diff --git a/config/set/downgrade-php70.php b/config/set/downgrade-php70.php index 195423ebe71..3e3423f6971 100644 --- a/config/set/downgrade-php70.php +++ b/config/set/downgrade-php70.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp70\Rector\ClassMethod\DowngradeParentTypeDeclarationRector; @@ -24,11 +25,10 @@ use Rector\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector; use Rector\DowngradePhp70\Rector\Spaceship\DowngradeSpaceshipRector; use Rector\DowngradePhp70\Rector\String_\DowngradeGeneratedScalarTypesRector; use Rector\DowngradePhp70\Rector\TryCatch\DowngradeCatchThrowableRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_56); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp70\Rector\TryCatch\DowngradeCatchThrowableRector::class); $services->set(\Rector\DowngradePhp70\Rector\Instanceof_\DowngradeInstanceofThrowableRector::class); $services->set(\Rector\DowngradePhp70\Rector\FunctionLike\DowngradeScalarTypeDeclarationRector::class); diff --git a/config/set/downgrade-php71.php b/config/set/downgrade-php71.php index c9d18829684..115457782de 100644 --- a/config/set/downgrade-php71.php +++ b/config/set/downgrade-php71.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp71\Rector\Array_\SymmetricArrayDestructuringToListRector; @@ -16,11 +17,10 @@ use Rector\DowngradePhp71\Rector\List_\DowngradeKeysInListRector; use Rector\DowngradePhp71\Rector\StaticCall\DowngradeClosureFromCallableRector; use Rector\DowngradePhp71\Rector\String_\DowngradeNegativeStringOffsetToStrlenRector; use Rector\DowngradePhp71\Rector\TryCatch\DowngradePipeToMultiCatchExceptionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_70); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeNullableTypeDeclarationRector::class); $services->set(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeVoidTypeDeclarationRector::class); $services->set(\Rector\DowngradePhp71\Rector\ClassConst\DowngradeClassConstantVisibilityRector::class); diff --git a/config/set/downgrade-php72.php b/config/set/downgrade-php72.php index 74f4fc941ab..0c8fda2855e 100644 --- a/config/set/downgrade-php72.php +++ b/config/set/downgrade-php72.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector; @@ -11,11 +12,10 @@ use Rector\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgR use Rector\DowngradePhp72\Rector\FuncCall\DowngradePregUnmatchedAsNullConstantRector; use Rector\DowngradePhp72\Rector\FuncCall\DowngradeStreamIsattyRector; use Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_71); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector::class); $services->set(\Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector::class); $services->set(\Rector\DowngradePhp72\Rector\FuncCall\DowngradePregUnmatchedAsNullConstantRector::class); diff --git a/config/set/downgrade-php73.php b/config/set/downgrade-php73.php index 072e0c6d2f6..db44f7274f2 100644 --- a/config/set/downgrade-php73.php +++ b/config/set/downgrade-php73.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp73\Rector\ConstFetch\DowngradePhp73JsonConstRector; @@ -12,11 +13,10 @@ use Rector\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCalls use Rector\DowngradePhp73\Rector\FuncCall\SetCookieOptionsArrayToArgumentsRector; use Rector\DowngradePhp73\Rector\List_\DowngradeListReferenceAssignmentRector; use Rector\DowngradePhp73\Rector\String_\DowngradeFlexibleHeredocSyntaxRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_72); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp73\Rector\String_\DowngradeFlexibleHeredocSyntaxRector::class); $services->set(\Rector\DowngradePhp73\Rector\List_\DowngradeListReferenceAssignmentRector::class); $services->set(\Rector\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector::class); diff --git a/config/set/downgrade-php74.php b/config/set/downgrade-php74.php index 97f5b905333..0e99df59f1f 100644 --- a/config/set/downgrade-php74.php +++ b/config/set/downgrade-php74.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp74\Rector\Array_\DowngradeArraySpreadRector; @@ -17,11 +18,10 @@ use Rector\DowngradePhp74\Rector\Interface_\DowngradePreviouslyImplementedInterf use Rector\DowngradePhp74\Rector\LNumber\DowngradeNumericLiteralSeparatorRector; use Rector\DowngradePhp74\Rector\MethodCall\DowngradeReflectionGetTypeRector; use Rector\DowngradePhp74\Rector\Property\DowngradeTypedPropertyRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_73); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp74\Rector\Property\DowngradeTypedPropertyRector::class); $services->set(\Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector::class); $services->set(\Rector\DowngradePhp74\Rector\ClassMethod\DowngradeCovariantReturnTypeRector::class); diff --git a/config/set/downgrade-php80.php b/config/set/downgrade-php80.php index 34178fb8292..21c6e4baf54 100644 --- a/config/set/downgrade-php80.php +++ b/config/set/downgrade-php80.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp80\Rector\ArrayDimFetch\DowngradeDereferenceableOperationRector; @@ -35,11 +36,10 @@ use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector; use Rector\DowngradePhp80\Rector\StaticCall\DowngradePhpTokenRector; use Rector\DowngradePhp80\ValueObject\DowngradeAttributeToAnnotation; use Rector\Removing\Rector\Class_\RemoveInterfacesRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_74); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\Removing\Rector\Class_\RemoveInterfacesRector::class)->configure([ // @see https://wiki.php.net/rfc/stringable 'Stringable', diff --git a/config/set/downgrade-php81.php b/config/set/downgrade-php81.php index 1783dbeccf8..ed40176a6ff 100644 --- a/config/set/downgrade-php81.php +++ b/config/set/downgrade-php81.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector; @@ -14,11 +15,10 @@ use Rector\DowngradePhp81\Rector\FunctionLike\DowngradeNewInInitializerRector; use Rector\DowngradePhp81\Rector\FunctionLike\DowngradePureIntersectionTypeRector; use Rector\DowngradePhp81\Rector\Instanceof_\DowngradePhp81ResourceReturnToObjectRector; use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $parameters = $containerConfigurator->parameters(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_80); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(\Rector\DowngradePhp81\Rector\ClassConst\DowngradeFinalizePublicClassConstantRector::class); $services->set(\Rector\DowngradePhp81\Rector\FuncCall\DowngradeFirstClassCallableSyntaxRector::class); $services->set(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradeNeverTypeDeclarationRector::class); diff --git a/config/set/early-return.php b/config/set/early-return.php index 43dd53fc916..a4956e7d012 100644 --- a/config/set/early-return.php +++ b/config/set/early-return.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; use Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector; use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector; @@ -14,9 +15,8 @@ use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector::class); $services->set(\Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector::class); $services->set(\Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector::class); diff --git a/config/set/flysystem-20.php b/config/set/flysystem-20.php index 4cf7bfadcc7..4f360491689 100644 --- a/config/set/flysystem-20.php +++ b/config/set/flysystem-20.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([ // Rename is now move, specific for files. new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'rename', 'move'), diff --git a/config/set/framework-extra-bundle-40.php b/config/set/framework-extra-bundle-40.php index 397f6e1bc43..7351512f2bb 100644 --- a/config/set/framework-extra-bundle-40.php +++ b/config/set/framework-extra-bundle-40.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Symfony\Rector\ClassMethod\RemoveServiceFromSensioRouteRector; use Rector\Symfony\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Symfony\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector::class); $services->set(\Rector\Symfony\Rector\ClassMethod\RemoveServiceFromSensioRouteRector::class); }; diff --git a/config/set/framework-extra-bundle-50.php b/config/set/framework-extra-bundle-50.php index 4b849e5ca88..cd6829116ec 100644 --- a/config/set/framework-extra-bundle-50.php +++ b/config/set/framework-extra-bundle-50.php @@ -3,9 +3,9 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Symfony\Rector\ClassMethod\TemplateAnnotationToThisRenderRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Symfony\Rector\ClassMethod\TemplateAnnotationToThisRenderRector::class); }; diff --git a/config/set/gmagick_to_imagick.php b/config/set/gmagick_to_imagick.php index 3f2b7bc5627..75988394f46 100644 --- a/config/set/gmagick_to_imagick.php +++ b/config/set/gmagick_to_imagick.php @@ -3,13 +3,13 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\Rector\Name\RenameClassRector; use Rector\Renaming\ValueObject\MethodCallRename; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; # https://www.php.net/manual/en/book.gmagick.php → https://www.php.net/manual/en/book.imagick.php -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Renaming\Rector\Name\RenameClassRector::class)->configure(['Gmagick' => 'Imagick', 'GmagickPixel' => 'ImagickPixel']); $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addimage', 'addImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addnoiseimage', 'addNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'annotateimage', 'annotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'blurimage', 'blurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'borderimage', 'borderImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'charcoalimage', 'charcoalImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'chopimage', 'chopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'commentimage', 'commentImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'compositeimage', 'compositeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropimage', 'cropImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropthumbnailimage', 'cropThumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cyclecolormapimage', 'cycleColormapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'deconstructimages', 'deconstructImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'despeckleimage', 'despeckleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'drawimage', 'drawImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'edgeimage', 'edgeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'embossimage', 'embossImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'enhanceimage', 'enhanceImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'equalizeimage', 'equalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flipimage', 'flipImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flopimage', 'flopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'frameimage', 'frameImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'gammaimage', 'gammaImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getcopyright', 'getCopyright'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getfilename', 'getFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebackgroundcolor', 'getImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageblueprimary', 'getImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebordercolor', 'getImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagechanneldepth', 'getImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolors', 'getImageColors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolorspace', 'getImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecompose', 'getImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedelay', 'getImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedepth', 'getImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedispose', 'getImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageextrema', 'getImageExtrema'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagefilename', 'getImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageformat', 'getImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegamma', 'getImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegreenprimary', 'getImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageheight', 'getImageHeight'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagehistogram', 'getImageHistogram'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageindex', 'getImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageinterlacescheme', 'getImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageiterations', 'getImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagematte', 'getImageMatte'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagemattecolor', 'getImageMatteColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageprofile', 'getImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageredprimary', 'getImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagerenderingintent', 'getImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageresolution', 'getImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagescene', 'getImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagesignature', 'getImageSignature'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagetype', 'getImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageunits', 'getImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewhitepoint', 'getImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewidth', 'getImageWidth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getpackagename', 'getPackageName'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getquantumdepth', 'getQuantumDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getreleasedate', 'getReleaseDate'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsamplingfactors', 'getSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsize', 'getSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getversion', 'getVersion'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'hasnextimage', 'hasNextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'haspreviousimage', 'hasPreviousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'implodeimage', 'implodeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'labelimage', 'labelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'levelimage', 'levelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'magnifyimage', 'magnifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'mapimage', 'mapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'medianfilterimage', 'medianFilterImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'minifyimage', 'minifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'modulateimage', 'modulateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'motionblurimage', 'motionBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'newimage', 'newImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'nextimage', 'nextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'normalizeimage', 'normalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'oilpaintimage', 'oilPaintImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'previousimage', 'previousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'profileimage', 'profileImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimage', 'quantizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimages', 'quantizeImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfontmetrics', 'queryFontMetrics'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfonts', 'queryFonts'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryformats', 'queryFormats'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'radialblurimage', 'radialBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'raiseimage', 'raiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimage', 'readimages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimageblob', 'readImageBlob'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimagefile', 'readImageFile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'reducenoiseimage', 'reduceNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimage', 'removeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimageprofile', 'removeImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resampleimage', 'resampleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resizeimage', 'resizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rollimage', 'rollImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rotateimage', 'rotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'scaleimage', 'scaleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'separateimagechannel', 'separateImageChannel'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setCompressionQuality', 'getCompressionQuality'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setfilename', 'setFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebackgroundcolor', 'setImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageblueprimary', 'setImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebordercolor', 'setImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagechanneldepth', 'setImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecolorspace', 'setImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecompose', 'setImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedelay', 'setImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedepth', 'setImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedispose', 'setImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagefilename', 'setImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageformat', 'setImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegamma', 'setImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegreenprimary', 'setImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageindex', 'setImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageinterlacescheme', 'setImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageiterations', 'setImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageprofile', 'setImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageredprimary', 'setImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagerenderingintent', 'setImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageresolution', 'setImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagescene', 'setImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagetype', 'setImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageunits', 'setImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagewhitepoint', 'setImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsamplingfactors', 'setSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsize', 'setSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'shearimage', 'shearImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'solarizeimage', 'solarizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'spreadimage', 'spreadImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'stripimage', 'stripImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'swirlimage', 'swirlImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'thumbnailimage', 'thumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'trimimage', 'trimImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'writeimage', 'writeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolor', 'getColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorcount', 'getColorCount'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorvalue', 'getColorValue'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolor', 'setColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolorvalue', 'setColorValue')]); }; diff --git a/config/set/guzzle50.php b/config/set/guzzle50.php index 0624717b6a4..1985a3a9d62 100644 --- a/config/set/guzzle50.php +++ b/config/set/guzzle50.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; use Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector; use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; use Rector\Transform\ValueObject\FuncCallToMethodCall; use Rector\Transform\ValueObject\StaticCallToFuncCall; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $configuration = [new \Rector\Transform\ValueObject\FuncCallToMethodCall('GuzzleHttp\\json_decode', 'GuzzleHttp\\Utils', 'jsonDecode'), new \Rector\Transform\ValueObject\FuncCallToMethodCall('GuzzleHttp\\get_path', 'GuzzleHttp\\Utils', 'getPath')]; $services->set(\Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector::class)->configure($configuration); $services->set(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class)->configure([new \Rector\Transform\ValueObject\StaticCallToFuncCall('GuzzleHttp\\Utils', 'setPath', 'GuzzleHttp\\set_path'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('GuzzleHttp\\Pool', 'batch', 'GuzzleHttp\\Pool\\batch')]); diff --git a/config/set/level/down-to-php52.php b/config/set/level/down-to-php52.php index 756e6092526..24d7582c0c7 100644 --- a/config/set/level/down-to-php52.php +++ b/config/set/level/down-to-php52.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_53); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_53); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_53); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_53); }; diff --git a/config/set/level/down-to-php53.php b/config/set/level/down-to-php53.php index 13afa956084..79a1910fbf1 100644 --- a/config/set/level/down-to-php53.php +++ b/config/set/level/down-to-php53.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_54); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_54); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_54); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_54); }; diff --git a/config/set/level/down-to-php54.php b/config/set/level/down-to-php54.php index 5b94da9e9d0..70a07fb7c73 100644 --- a/config/set/level/down-to-php54.php +++ b/config/set/level/down-to-php54.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_55); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_55); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_55); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_55); }; diff --git a/config/set/level/down-to-php55.php b/config/set/level/down-to-php55.php index c24d92226e2..8a2b450df2d 100644 --- a/config/set/level/down-to-php55.php +++ b/config/set/level/down-to-php55.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_56); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_56); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_56); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_56); }; diff --git a/config/set/level/down-to-php56.php b/config/set/level/down-to-php56.php index 17402061382..919669bce3e 100644 --- a/config/set/level/down-to-php56.php +++ b/config/set/level/down-to-php56.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_70); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_70); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_70); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_70); }; diff --git a/config/set/level/down-to-php70.php b/config/set/level/down-to-php70.php index 412bb3d9ee2..25d7c543c96 100644 --- a/config/set/level/down-to-php70.php +++ b/config/set/level/down-to-php70.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_71); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_71); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_71); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_71); }; diff --git a/config/set/level/down-to-php71.php b/config/set/level/down-to-php71.php index 80ca12e9c1f..626c8477140 100644 --- a/config/set/level/down-to-php71.php +++ b/config/set/level/down-to-php71.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_72); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_72); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_72); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_72); }; diff --git a/config/set/level/down-to-php72.php b/config/set/level/down-to-php72.php index 1f6bb27f483..a914d3099ba 100644 --- a/config/set/level/down-to-php72.php +++ b/config/set/level/down-to-php72.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_73); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_73); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_73); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_73); }; diff --git a/config/set/level/down-to-php73.php b/config/set/level/down-to-php73.php index 489a8418a53..e775f857b40 100644 --- a/config/set/level/down-to-php73.php +++ b/config/set/level/down-to-php73.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_74); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_74); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_74); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_74); }; diff --git a/config/set/level/down-to-php74.php b/config/set/level/down-to-php74.php index e4f4b74ad38..6e39d3e36d4 100644 --- a/config/set/level/down-to-php74.php +++ b/config/set/level/down-to-php74.php @@ -3,10 +3,10 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeLevelSetList; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_80); - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_80); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeLevelSetList::DOWN_TO_PHP_80); + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_80); }; diff --git a/config/set/level/down-to-php80.php b/config/set/level/down-to-php80.php index 165bcf1d4cc..1d28e86750f 100644 --- a/config/set/level/down-to-php80.php +++ b/config/set/level/down-to-php80.php @@ -3,8 +3,8 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Set\ValueObject\DowngradeSetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_81); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\DowngradeSetList::PHP_81); }; diff --git a/config/set/level/up-to-php54.php b/config/set/level/up-to-php54.php index cbe44bb2528..0e96b247423 100644 --- a/config/set/level/up-to-php54.php +++ b/config/set/level/up-to-php54.php @@ -3,14 +3,14 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_54); - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_53); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_54); + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_53); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_54); }; diff --git a/config/set/level/up-to-php55.php b/config/set/level/up-to-php55.php index c222de3b5bb..57e86cc1536 100644 --- a/config/set/level/up-to-php55.php +++ b/config/set/level/up-to-php55.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_55); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_54); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_55); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_54); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_55); }; diff --git a/config/set/level/up-to-php56.php b/config/set/level/up-to-php56.php index c88831fe41e..02f427d949e 100644 --- a/config/set/level/up-to-php56.php +++ b/config/set/level/up-to-php56.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_56); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_55); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_56); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_55); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_56); }; diff --git a/config/set/level/up-to-php70.php b/config/set/level/up-to-php70.php index 55eb35d6590..fd982bb9c5e 100644 --- a/config/set/level/up-to-php70.php +++ b/config/set/level/up-to-php70.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_70); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_56); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_70); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_56); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_70); }; diff --git a/config/set/level/up-to-php71.php b/config/set/level/up-to-php71.php index 2ad43868f3e..523b8dddfbc 100644 --- a/config/set/level/up-to-php71.php +++ b/config/set/level/up-to-php71.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_71); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_70); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_71); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_70); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_71); }; diff --git a/config/set/level/up-to-php72.php b/config/set/level/up-to-php72.php index 6cb64832d67..ccec6367bc2 100644 --- a/config/set/level/up-to-php72.php +++ b/config/set/level/up-to-php72.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_72); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_71); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_72); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_71); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_72); }; diff --git a/config/set/level/up-to-php73.php b/config/set/level/up-to-php73.php index 81e5655ea68..d00fd41a3bc 100644 --- a/config/set/level/up-to-php73.php +++ b/config/set/level/up-to-php73.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_73); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_72); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_73); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_72); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_73); }; diff --git a/config/set/level/up-to-php74.php b/config/set/level/up-to-php74.php index 88b9bfbf8cb..072b3a511b2 100644 --- a/config/set/level/up-to-php74.php +++ b/config/set/level/up-to-php74.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_74); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_73); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_74); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_73); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_74); }; diff --git a/config/set/level/up-to-php80.php b/config/set/level/up-to-php80.php index a4398e7f538..05f1dc59074 100644 --- a/config/set/level/up-to-php80.php +++ b/config/set/level/up-to-php80.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_80); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_74); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_80); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_74); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_80); }; diff --git a/config/set/level/up-to-php81.php b/config/set/level/up-to-php81.php index aea30cb09de..019ec433269 100644 --- a/config/set/level/up-to-php81.php +++ b/config/set/level/up-to-php81.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $containerConfigurator->import(\Rector\Set\ValueObject\SetList::PHP_81); - $containerConfigurator->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_80); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $rectorConfig->import(\Rector\Set\ValueObject\SetList::PHP_81); + $rectorConfig->import(\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_80); // parameter must be defined after import, to override impored param version - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(\Rector\Core\Configuration\Option::PHP_VERSION_FEATURES, \Rector\Core\ValueObject\PhpVersion::PHP_81); }; diff --git a/config/set/monolog20.php b/config/set/monolog20.php index 15c1e320ff6..c04a0399663 100644 --- a/config/set/monolog20.php +++ b/config/set/monolog20.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; # https://github.com/Seldaek/monolog/commit/39f8a20e6dadc0194e846b254c5f23d1c732290b#diff-dce565f403e044caa5e6a0d988339430 -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addDebug', 'debug'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addInfo', 'info'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addNotice', 'notice'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addWarning', 'warning'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addError', 'error'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addCritical', 'critical'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addAlert', 'alert'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'addEmergency', 'emergency'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'warn', 'warning'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'err', 'error'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'crit', 'critical'), new \Rector\Renaming\ValueObject\MethodCallRename('Monolog\\Logger', 'emerg', 'emergency')]); }; diff --git a/config/set/mysql-to-mysqli.php b/config/set/mysql-to-mysqli.php index ffd05285f82..842c4492a6a 100644 --- a/config/set/mysql-to-mysqli.php +++ b/config/set/mysql-to-mysqli.php @@ -5,6 +5,7 @@ namespace RectorPrefix20220412; use Rector\Arguments\Rector\FuncCall\SwapFuncCallArgumentsRector; use Rector\Arguments\ValueObject\SwapFuncCallArguments; +use Rector\Config\RectorConfig; use Rector\MysqlToMysqli\Rector\Assign\MysqlAssignToMysqliRector; use Rector\MysqlToMysqli\Rector\FuncCall\MysqlFuncCallToMysqliRector; use Rector\MysqlToMysqli\Rector\FuncCall\MysqlPConnectToMysqliConnectRector; @@ -13,9 +14,8 @@ use Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector; use Rector\Removing\ValueObject\RemoveFuncCallArg; use Rector\Renaming\Rector\ConstFetch\RenameConstantRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); # https://stackoverflow.com/a/1390625/1348344 # https://github.com/philip/MySQLConverterTool/blob/master/Converter.php # https://www.phpclasses.org/blog/package/9199/post/3-Smoothly-Migrate-your-PHP-Code-using-the-Old-MySQL-extension-to-MySQLi.html diff --git a/config/set/naming.php b/config/set/naming.php index 490fc998c64..9de55c25d80 100644 --- a/config/set/naming.php +++ b/config/set/naming.php @@ -3,15 +3,15 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector; use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector; use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector; use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector; use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector; use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector::class); $services->set(\Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector::class); $services->set(\Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector::class); diff --git a/config/set/php52.php b/config/set/php52.php index bec2270708a..afecdf5a897 100644 --- a/config/set/php52.php +++ b/config/set/php52.php @@ -3,13 +3,13 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php52\Rector\Property\VarToPublicPropertyRector; use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector; use Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector; use Rector\Removing\ValueObject\RemoveFuncCallArg; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php52\Rector\Property\VarToPublicPropertyRector::class); $services->set(\Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector::class); $services->set(\Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector::class)->configure([ diff --git a/config/set/php53.php b/config/set/php53.php index 8c61412a455..8f4204113ee 100644 --- a/config/set/php53.php +++ b/config/set/php53.php @@ -3,12 +3,12 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector; use Rector\Php53\Rector\Ternary\TernaryToElvisRector; use Rector\Php53\Rector\Variable\ReplaceHttpServerVarsByServerRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php53\Rector\Ternary\TernaryToElvisRector::class); $services->set(\Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector::class); $services->set(\Rector\Php53\Rector\Variable\ReplaceHttpServerVarsByServerRector::class); diff --git a/config/set/php54.php b/config/set/php54.php index c5d6ce23a96..33ec982c6cc 100644 --- a/config/set/php54.php +++ b/config/set/php54.php @@ -3,12 +3,12 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector; use Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class)->configure(['mysqli_param_count' => 'mysqli_stmt_param_count']); $services->set(\Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector::class); $services->set(\Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector::class); diff --git a/config/set/php55.php b/config/set/php55.php index 97e9e3d7df3..63307c2d659 100644 --- a/config/set/php55.php +++ b/config/set/php55.php @@ -3,14 +3,14 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector; use Rector\Php55\Rector\FuncCall\GetCalledClassToSelfClassRector; use Rector\Php55\Rector\FuncCall\GetCalledClassToStaticClassRector; use Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class); $services->set(\Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector::class); $services->set(\Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector::class); diff --git a/config/set/php56.php b/config/set/php56.php index 6d94f1bcb54..89d28bfa99b 100644 --- a/config/set/php56.php +++ b/config/set/php56.php @@ -3,12 +3,12 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php56\Rector\FuncCall\PowToExpRector; use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php56\Rector\FuncCall\PowToExpRector::class); $services->set(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class)->configure(['mcrypt_generic_end' => 'mcrypt_generic_deinit', 'set_socket_blocking' => 'stream_set_blocking', 'ocibindbyname' => 'oci_bind_by_name', 'ocicancel' => 'oci_cancel', 'ocicolumnisnull' => 'oci_field_is_null', 'ocicolumnname' => 'oci_field_name', 'ocicolumnprecision' => 'oci_field_precision', 'ocicolumnscale' => 'oci_field_scale', 'ocicolumnsize' => 'oci_field_size', 'ocicolumntype' => 'oci_field_type', 'ocicolumntyperaw' => 'oci_field_type_raw', 'ocicommit' => 'oci_commit', 'ocidefinebyname' => 'oci_define_by_name', 'ocierror' => 'oci_error', 'ociexecute' => 'oci_execute', 'ocifetch' => 'oci_fetch', 'ocifetchstatement' => 'oci_fetch_all', 'ocifreecursor' => 'oci_free_statement', 'ocifreestatement' => 'oci_free_statement', 'ociinternaldebug' => 'oci_internal_debug', 'ocilogoff' => 'oci_close', 'ocilogon' => 'oci_connect', 'ocinewcollection' => 'oci_new_collection', 'ocinewcursor' => 'oci_new_cursor', 'ocinewdescriptor' => 'oci_new_descriptor', 'ocinlogon' => 'oci_new_connect', 'ocinumcols' => 'oci_num_fields', 'ociparse' => 'oci_parse', 'ociplogon' => 'oci_pconnect', 'ociresult' => 'oci_result', 'ocirollback' => 'oci_rollback', 'ocirowcount' => 'oci_num_rows', 'ociserverversion' => 'oci_server_version', 'ocisetprefetch' => 'oci_set_prefetch', 'ocistatementtype' => 'oci_statement_type']); # inspired by level in psalm - https://github.com/vimeo/psalm/blob/82e0bcafac723fdf5007a31a7ae74af1736c9f6f/tests/FileManipulationTest.php#L1063 diff --git a/config/set/php70.php b/config/set/php70.php index a8194da396c..7dc710dbdcc 100644 --- a/config/set/php70.php +++ b/config/set/php70.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php70\Rector\Assign\ListSplitStringRector; use Rector\Php70\Rector\Assign\ListSwapArrayOrderRector; use Rector\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector; @@ -22,9 +23,8 @@ use Rector\Php70\Rector\Switch_\ReduceMultipleDefaultSwitchRector; use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector; use Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector; use Rector\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php70\Rector\ClassMethod\Php4ConstructorRector::class); $services->set(\Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector::class); $services->set(\Rector\Php70\Rector\FuncCall\RandomFunctionRector::class); diff --git a/config/set/php71.php b/config/set/php71.php index 33aa0e07419..85bf274c7e9 100644 --- a/config/set/php71.php +++ b/config/set/php71.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php71\Rector\Assign\AssignArrayToStringRector; use Rector\Php71\Rector\BinaryOp\BinaryOpBetweenNumberAndStringRector; use Rector\Php71\Rector\BooleanOr\IsIterableRector; @@ -11,9 +12,8 @@ use Rector\Php71\Rector\FuncCall\CountOnNullRector; use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; use Rector\Php71\Rector\List_\ListToArrayDestructRector; use Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php71\Rector\BooleanOr\IsIterableRector::class); $services->set(\Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class); $services->set(\Rector\Php71\Rector\Assign\AssignArrayToStringRector::class); diff --git a/config/set/php72.php b/config/set/php72.php index 833dcd4a9e1..36f29f22053 100644 --- a/config/set/php72.php +++ b/config/set/php72.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php72\Rector\Assign\ListEachRector; use Rector\Php72\Rector\Assign\ReplaceEachAssignmentWithKeyCurrentRector; use Rector\Php72\Rector\FuncCall\CreateFunctionToAnonymousFunctionRector; @@ -14,9 +15,8 @@ use Rector\Php72\Rector\FuncCall\StringsAssertNakedRector; use Rector\Php72\Rector\Unset_\UnsetCastRector; use Rector\Php72\Rector\While_\WhileEachToForeachRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php72\Rector\While_\WhileEachToForeachRector::class); $services->set(\Rector\Php72\Rector\Assign\ListEachRector::class); $services->set(\Rector\Php72\Rector\Assign\ReplaceEachAssignmentWithKeyCurrentRector::class); diff --git a/config/set/php73.php b/config/set/php73.php index aa4dfed0e39..39bbd008dd9 100644 --- a/config/set/php73.php +++ b/config/set/php73.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector; use Rector\Php73\Rector\BooleanOr\IsCountableRector; use Rector\Php73\Rector\ConstFetch\SensitiveConstantNameRector; @@ -14,9 +15,8 @@ use Rector\Php73\Rector\FuncCall\SetCookieRector; use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector; use Rector\Php73\Rector\String_\SensitiveHereNowDocRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php73\Rector\BooleanOr\IsCountableRector::class); $services->set(\Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class); $services->set(\Rector\Php73\Rector\FuncCall\SensitiveDefineRector::class); diff --git a/config/set/php74.php b/config/set/php74.php index ae4b94a769b..8749cca12da 100644 --- a/config/set/php74.php +++ b/config/set/php74.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php74\Rector\ArrayDimFetch\CurlyToSquareBracketArrayStringRector; use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector; use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector; @@ -18,9 +19,8 @@ use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector; use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php74\Rector\Property\TypedPropertyRector::class); $services->set(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class)->configure([ #the_real_type diff --git a/config/set/php80.php b/config/set/php80.php index e15548713d6..83e20054432 100644 --- a/config/set/php80.php +++ b/config/set/php80.php @@ -8,6 +8,7 @@ use Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector; use Rector\Arguments\ValueObject\ArgumentAdder; use Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue; use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector; +use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector; use Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector; use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; @@ -27,9 +28,8 @@ use Rector\Php80\Rector\Ternary\GetDebugTypeRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; use Rector\Transform\ValueObject\StaticCallToFuncCall; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Php80\Rector\FunctionLike\UnionTypesRector::class); $services->set(\Rector\Php80\Rector\NotIdentical\StrContainsRector::class); $services->set(\Rector\Php80\Rector\Identical\StrStartsWithRector::class); diff --git a/config/set/php81.php b/config/set/php81.php index e91f97bac3e..9896a437753 100644 --- a/config/set/php81.php +++ b/config/set/php81.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector; use Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector; use Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector; @@ -13,9 +14,8 @@ use Rector\Php81\Rector\FunctionLike\IntersectionTypesRector; use Rector\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector; use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector::class); $services->set(\Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector::class); $services->set(\Rector\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector::class); diff --git a/config/set/privatization.php b/config/set/privatization.php index 5bdbf4f4f49..fc2fe43dfeb 100644 --- a/config/set/privatization.php +++ b/config/set/privatization.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\Privatization\Rector\Class_\ChangeGlobalVariablesToPropertiesRector; use Rector\Privatization\Rector\Class_\ChangeLocalPropertyToVariableRector; use Rector\Privatization\Rector\Class_\ChangeReadOnlyVariableWithDefaultValueToConstantRector; @@ -12,9 +13,8 @@ use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector; use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector::class); $services->set(\Rector\Privatization\Rector\Class_\ChangeGlobalVariablesToPropertiesRector::class); $services->set(\Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class); diff --git a/config/set/psr-4.php b/config/set/psr-4.php index 1fbb5d86b9a..d931017ba7c 100644 --- a/config/set/psr-4.php +++ b/config/set/psr-4.php @@ -3,11 +3,11 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; use Rector\PSR4\Rector\Namespace_\MultipleClassFileToPsr4ClassesRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector::class); $services->set(\Rector\PSR4\Rector\Namespace_\MultipleClassFileToPsr4ClassesRector::class); }; diff --git a/config/set/type-declaration-strict.php b/config/set/type-declaration-strict.php index e8881162862..5dbc55a3038 100644 --- a/config/set/type-declaration-strict.php +++ b/config/set/type-declaration-strict.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; use Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector; @@ -13,9 +14,8 @@ use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector::class); $services->set(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector::class); diff --git a/config/set/type-declaration.php b/config/set/type-declaration.php index 4373c78d149..f8efd447b39 100644 --- a/config/set/type-declaration.php +++ b/config/set/type-declaration.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector; @@ -11,9 +12,8 @@ use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector; use Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector; use Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector::class); $services->set(\Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector::class); $services->set(\Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector::class); diff --git a/config/set/unwrap-compat.php b/config/set/unwrap-compat.php index e8290451bc1..06e288d8e39 100644 --- a/config/set/unwrap-compat.php +++ b/config/set/unwrap-compat.php @@ -3,9 +3,9 @@ declare (strict_types=1); namespace RectorPrefix20220412; +use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void { - $services = $containerConfigurator->services(); +return static function (\Rector\Config\RectorConfig $rectorConfig) : void { + $services = $rectorConfig->services(); $services->set(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector::class); }; diff --git a/docs/beyond_php_file_processors.md b/docs/beyond_php_file_processors.md index 365aa0b2827..22faaaa7a1b 100644 --- a/docs/beyond_php_file_processors.md +++ b/docs/beyond_php_file_processors.md @@ -17,60 +17,48 @@ Let´s say you want to define a custom configuration where you want to update th All you have to do is using the ChangePackageVersionComposerRector: ```php -// rector.php - use Rector\Composer\Rector\ChangePackageVersionComposerRector; use Rector\Composer\ValueObject\PackageAndVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(ChangePackageVersionComposerRector::class) - ->configure([ - new PackageAndVersion('symfony/yaml', '^5.0'), - ]); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->ruleWithConfiguration(ChangePackageVersionComposerRector::class, [ + new PackageAndVersion('symfony/yaml', '^5.0'), + ]); }; ``` There are some more rules related to manipulate your composer.json files. Let´s see them in action: ```php -// rector.php - use Rector\Composer\Rector\AddPackageToRequireComposerRector; use Rector\Composer\Rector\AddPackageToRequireDevComposerRector; use Rector\Composer\Rector\RemovePackageComposerRector; use Rector\Composer\Rector\ReplacePackageAndVersionComposerRector; use Rector\Composer\ValueObject\PackageAndVersion; use Rector\Composer\ValueObject\ReplacePackageAndVersion; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; - -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); +use Rector\Config\RectorConfig; +return static function (RectorConfig $rectorConfig): void { // Add a package to the require section of your composer.json - $services->set(AddPackageToRequireComposerRector::class) - ->configure([ - new PackageAndVersion('symfony/yaml', '^5.0'), - ]); + $rectorConfig->ruleWithConfiguration(AddPackageToRequireComposerRector::class, [ + new PackageAndVersion('symfony/yaml', '^5.0'), + ]); // Add a package to the require dev section of your composer.json - $services->set(AddPackageToRequireDevComposerRector::class) - ->configure([ - new PackageAndVersion('phpunit/phpunit', '^9.0'), - ]); + $rectorConfig->ruleWithConfiguration(AddPackageToRequireDevComposerRector::class, [ + new PackageAndVersion('phpunit/phpunit', '^9.0'), + ]); // Remove a package from composer.json - $services->set(RemovePackageComposerRector::class) - ->configure([ - 'symfony/console' - ]); + $rectorConfig->ruleWithConfiguration(RemovePackageComposerRector::class, [ + 'symfony/console' + ]); - // Replace a package in the composer.json - $services->set(ReplacePackageAndVersionComposerRector::class) - ->configure([ - new ReplacePackageAndVersion('vendor1/package2', 'vendor2/package1', '^3.0'), - ]); + // Replace a package in the composer.json + $rectorConfig->ruleWithConfiguration(ReplacePackageAndVersionComposerRector::class, [ + new ReplacePackageAndVersion('vendor1/package2', 'vendor2/package1', '^3.0'), + ]); }; ``` diff --git a/docs/create_own_rule.md b/docs/create_own_rule.md index 63a7655372d..83f078c16ba 100644 --- a/docs/create_own_rule.md +++ b/docs/create_own_rule.md @@ -146,17 +146,11 @@ composer dump-autoload ## 2. Register It ```php -services(); - $services->set(MyFirstRector::class); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->rule(MyFirstRector::class); }; ``` diff --git a/docs/how_it_works.md b/docs/how_it_works.md index 22c7692b097..d709202f593 100644 --- a/docs/how_it_works.md +++ b/docs/how_it_works.md @@ -66,23 +66,18 @@ E.g. in this case, first the `@expectedException` annotation will be changed to then the `setExpectedException` method will be changed to `expectedException`. ```php -rule(ExceptionAnnotationRector::class); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; - -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); - $services->set(Rector\PHPUnit\Rector\ClassMethod\ExceptionAnnotationRector::class); - $services->set(Rector\Renaming\Rector\MethodCall\RenameMethodRector::class) - ->arg('$oldToNewMethodsByClass', [ - PHPUnit\Framework\TestClass::class => [ - 'setExpectedException' => 'expectedException', - 'setExpectedExceptionRegExp' => 'expectedException', - ], - ]); + $rectorConfig->ruleWithConfiguration(Rector\Renaming\Rector\MethodCall\RenameMethodRector::class, [ + new MethodCallRename('PHPUnit\Framework\TestClass', 'setExpectedException', 'expectedException'), + new MethodCallRename('PHPUnit\Framework\TestClass', 'setExpectedExceptionRegExp', 'expectedException'), + ]); }; ``` diff --git a/docs/how_to_configure_rules.md b/docs/how_to_configure_rules.md index d7de5fe5528..b431b97cf1a 100644 --- a/docs/how_to_configure_rules.md +++ b/docs/how_to_configure_rules.md @@ -5,20 +5,12 @@ Rector rules that implement `Rector\Core\Contract\Rector\ConfigurableRectorInter Typical example is `Rector\Renaming\Rector\Name\RenameClassRector`: ```php -services(); - $services->set(RenameClassRector::class) - ->configure([ - 'App\SomeOldClass' => 'App\SomeNewClass', - ]); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ + 'App\SomeOldClass' => 'App\SomeNewClass', + ]); }; ``` diff --git a/docs/how_to_create_custom_fileprocessor.md b/docs/how_to_create_custom_fileprocessor.md index d7b291c0c5c..a2a698fbcd7 100644 --- a/docs/how_to_create_custom_fileprocessor.md +++ b/docs/how_to_create_custom_fileprocessor.md @@ -62,14 +62,12 @@ final class BoldStatementFileProcessor implements FileProcessorInterface Now register your FileProcessor in your configuration (actually in the container): ```php -services(); + $services = $rectorConfig->services(); $services->set(BoldStatementFileProcessor::class); }; ``` @@ -107,8 +105,8 @@ use Rector\Core\ValueObject\Application\File; final class BoldStatementMakeAmericaGreatAgainRector implements BoldStatementRectorInterface { /** - * @var string - */ + * @var string + */ private const OLD_STATEMENT = 'Make america great again'; public function transform(string $content): string @@ -185,18 +183,16 @@ Notice the annotation BoldStatementRectorInterface[]. This is important to injec Yes, we said active. So last but not least we must register our new rule in the container, so it is applied: ```php -services(); + $services = $rectorConfig->services(); $services->set(BoldStatementFileProcessor::class); - $services->set(BoldStatementMakeAmericaGreatAgainRector::class); + + $rectorConfig->rule(BoldStatementMakeAmericaGreatAgainRector::class); }; ``` diff --git a/docs/how_to_ignore_rule_or_paths.md b/docs/how_to_ignore_rule_or_paths.md index b682083f3da..fe31b2c0322 100644 --- a/docs/how_to_ignore_rule_or_paths.md +++ b/docs/how_to_ignore_rule_or_paths.md @@ -3,21 +3,12 @@ ## Preferred Way: Config ```php -parameters(); +use Rector\Config\RectorConfig; +return static function (RectorConfig $rectorConfig): void { // is there a file you need to skip? - $parameters->set(Option::SKIP, [ + $rectorConfig->skip([ // single file __DIR__ . '/src/ComplicatedFile.php', // or directory diff --git a/docs/how_to_register_custom_setlist_constant.md b/docs/how_to_register_custom_setlist_constant.md index 9c7d06562b5..fd90215fab7 100644 --- a/docs/how_to_register_custom_setlist_constant.md +++ b/docs/how_to_register_custom_setlist_constant.md @@ -20,37 +20,27 @@ Now, you can register your custom `SetList`'s constant via import from `$contain ```php -import(SetList::MY_FRAMEWORK_20); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([SetList::MY_FRAMEWORK_20]); - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [__DIR__ . '/src']); + $rectorConfig->paths([__DIR__ . '/src']); }; ``` Note that if you are looking for the downgrade categories, there is already the `DowngradeSetList`: ```php -import(DowngradeSetList::PHP_70) +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([DowngradeSetList::PHP_70]) - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::PATHS, [__DIR__ . '/src']); + $rectorConfig->paths([__DIR__ . '/src']); }; ``` diff --git a/docs/init_command.md b/docs/init_command.md index f0fda33ff28..23c76c543d5 100644 --- a/docs/init_command.md +++ b/docs/init_command.md @@ -9,19 +9,16 @@ vendor/bin/rector init This will create a `rector.php` if it doesn't already exist in your root directory with some sensitive defaults to start with. ```php -// rector.php -use Rector\Core\Configuration\Option; use Rector\Php74\Rector\Property\TypedPropertyRector; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (RectorConfig $rectorConfig): void { // here we can define, what sets of rules will be applied - $containerConfigurator->import(SetList::CODE_QUALITY); + $rectorConfig->sets([SetList::CODE_QUALITY]); // register single rule - $services = $containerConfigurator->services(); - $services->set(TypedPropertyRector::class); + $rectorConfig->rule(TypedPropertyRector::class); }; ``` @@ -36,20 +33,20 @@ The rector.php file for TYPO3 contains useful framework specific defaults to sta ```php use Ssch\TYPO3Rector\Set\Typo3SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Rector\PostRector\Rector\NameImportingPostRector; use Rector\Core\Configuration\Option; +use Rector\Config\RectorConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(Typo3SetList::TYPO3_76); - $containerConfigurator->import(Typo3SetList::TYPO3_87); - $containerConfigurator->import(Typo3SetList::TYPO3_95); - $containerConfigurator->import(Typo3SetList::TYPO3_104); - $containerConfigurator->import(Typo3SetList::TYPO3_11); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->sets([ + Typo3SetList::TYPO3_76, + Typo3SetList::TYPO3_87, + Typo3SetList::TYPO3_95, + Typo3SetList::TYPO3_104, + Typo3SetList::TYPO3_11, + ]); - // get parameters - $parameters = $containerConfigurator->parameters(); - $parameters->set(Option::SKIP, [ + $rectorConfig->skip([ NameImportingPostRector::class => [ 'ClassAliasMap.php', 'ext_localconf.php', diff --git a/docs/rector_rules_overview.md b/docs/rector_rules_overview.md index df130d26381..24804dec2db 100644 --- a/docs/rector_rules_overview.md +++ b/docs/rector_rules_overview.md @@ -110,7 +110,7 @@ use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector; use Rector\Arguments\ValueObject\ArgumentAdder; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ArgumentAdderRector::class) @@ -151,7 +151,7 @@ use Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector; use Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FunctionArgumentDefaultValueReplacerRector::class) @@ -181,7 +181,7 @@ use Rector\Arguments\Rector\MethodCall\RemoveMethodCallParamRector; use Rector\Arguments\ValueObject\RemoveMethodCallParam; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveMethodCallParamRector::class) @@ -217,7 +217,7 @@ use Rector\Arguments\Rector\ClassMethod\ReplaceArgumentDefaultValueRector; use Rector\Arguments\ValueObject\ReplaceArgumentDefaultValue; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReplaceArgumentDefaultValueRector::class) @@ -248,7 +248,7 @@ use Rector\Arguments\Rector\FuncCall\SwapFuncCallArgumentsRector; use Rector\Arguments\ValueObject\SwapFuncCallArguments; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(SwapFuncCallArgumentsRector::class) @@ -1838,7 +1838,7 @@ Replace PREG delimiter with configured one use Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ConsistentPregDelimiterRector::class) @@ -2016,7 +2016,7 @@ Order attributes by desired names use Rector\CodingStyle\Rector\ClassMethod\OrderAttributesRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(OrderAttributesRector::class) @@ -2087,7 +2087,7 @@ use Rector\CodingStyle\Enum\PreferenceSelfThis; use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(PreferThisOrSelfMethodCallRector::class) @@ -2163,7 +2163,7 @@ use Rector\CodingStyle\Rector\ClassMethod\ReturnArrayClassMethodToYieldRector; use Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReturnArrayClassMethodToYieldRector::class) @@ -2464,7 +2464,7 @@ use Rector\Composer\Rector\AddPackageToRequireComposerRector; use Rector\Composer\ValueObject\PackageAndVersion; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddPackageToRequireComposerRector::class) @@ -2497,7 +2497,7 @@ use Rector\Composer\Rector\AddPackageToRequireDevComposerRector; use Rector\Composer\ValueObject\PackageAndVersion; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddPackageToRequireDevComposerRector::class) @@ -2530,7 +2530,7 @@ use Rector\Composer\Rector\ChangePackageVersionComposerRector; use Rector\Composer\ValueObject\PackageAndVersion; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ChangePackageVersionComposerRector::class) @@ -2563,7 +2563,7 @@ Remove package from "require" and "require-dev" in `composer.json` use Rector\Composer\Rector\RemovePackageComposerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemovePackageComposerRector::class) @@ -2596,7 +2596,7 @@ use Rector\Composer\Rector\RenamePackageComposerRector; use Rector\Composer\ValueObject\RenamePackage; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenamePackageComposerRector::class) @@ -2630,7 +2630,7 @@ use Rector\Composer\Rector\ReplacePackageAndVersionComposerRector; use Rector\Composer\ValueObject\ReplacePackageAndVersion; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReplacePackageAndVersionComposerRector::class) @@ -2725,7 +2725,7 @@ Remove annotation by names use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveAnnotationRector::class) @@ -3254,7 +3254,7 @@ Remove unneeded PHP_VERSION_ID check use Rector\DeadCode\Rector\ConstFetch\RemovePhpVersionIdCheckRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemovePhpVersionIdCheckRector::class) @@ -3457,7 +3457,7 @@ Remove unused private properties use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveUnusedPrivatePropertyRector::class) @@ -3723,7 +3723,7 @@ Add method parent call, in case new parent method is added use Rector\DependencyInjection\Rector\ClassMethod\AddMethodParentCallRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddMethodParentCallRector::class) @@ -4684,7 +4684,7 @@ Change param type to match the lowest type in whole family tree use Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DowngradeParameterTypeWideningRector::class) @@ -5272,7 +5272,7 @@ use Rector\DowngradePhp80\Rector\Class_\DowngradeAttributeToAnnotationRector; use Rector\DowngradePhp80\ValueObject\DowngradeAttributeToAnnotation; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DowngradeAttributeToAnnotationRector::class) @@ -6787,7 +6787,7 @@ Replace string class names by ::class constant use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(StringClassNameToClassConstantRector::class) @@ -7323,7 +7323,7 @@ Changes reserved "Object" name to "Object" where can be configure use Rector\Php71\Rector\Name\ReservedObjectRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReservedObjectRector::class) @@ -7685,7 +7685,7 @@ Add "_" as thousands separator in numbers for higher or equals to limitValue con use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddLiteralSeparatorToNumberRector::class) @@ -7952,7 +7952,7 @@ Changes property type by `@var` annotations or default value. use Rector\Php74\Rector\Property\TypedPropertyRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(TypedPropertyRector::class) @@ -8019,7 +8019,7 @@ use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Php80\ValueObject\AnnotationToAttribute; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AnnotationToAttributeRector::class) @@ -8125,7 +8125,7 @@ Refactor Doctrine `@annotation` annotated class to a PHP 8.0 attribute class use Rector\Php80\Rector\Class_\DoctrineAnnotationClassToAttributeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DoctrineAnnotationClassToAttributeRector::class) @@ -8958,7 +8958,7 @@ use Rector\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector; use Rector\Privatization\ValueObject\ReplaceStringWithClassConstant; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReplaceStringWithClassConstantRector::class) @@ -8996,7 +8996,7 @@ use Rector\Removing\Rector\ClassMethod\ArgumentRemoverRector; use Rector\Removing\ValueObject\ArgumentRemover; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ArgumentRemoverRector::class) @@ -9027,7 +9027,7 @@ use Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector; use Rector\Removing\ValueObject\RemoveFuncCallArg; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveFuncCallArgRector::class) @@ -9057,7 +9057,7 @@ use Rector\Removing\Rector\FuncCall\RemoveFuncCallRector; use Rector\Removing\ValueObject\RemoveFuncCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveFuncCallRector::class) @@ -9086,7 +9086,7 @@ Removes interfaces usage from class. use Rector\Removing\Rector\Class_\RemoveInterfacesRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveInterfacesRector::class) @@ -9117,7 +9117,7 @@ Remove namespace by configured namespace names use Rector\Removing\Rector\Namespace_\RemoveNamespaceRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveNamespaceRector::class) @@ -9148,7 +9148,7 @@ Removes extends class by name use Rector\Removing\Rector\Class_\RemoveParentRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveParentRector::class) @@ -9179,7 +9179,7 @@ Remove specific traits from code use Rector\Removing\Rector\Class_\RemoveTraitUseRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveTraitUseRector::class) @@ -9239,7 +9239,7 @@ use Rector\Renaming\Rector\FileWithoutNamespace\PseudoNamespaceToNamespaceRector use Rector\Renaming\ValueObject\PseudoNamespaceToNamespace; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(PseudoNamespaceToNamespaceRector::class) @@ -9272,7 +9272,7 @@ use Rector\Renaming\Rector\ClassMethod\RenameAnnotationRector; use Rector\Renaming\ValueObject\RenameAnnotationByType; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameAnnotationRector::class) @@ -9313,7 +9313,7 @@ use Rector\Renaming\ValueObject\RenameClassAndConstFetch; use Rector\Renaming\ValueObject\RenameClassConstFetch; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameClassConstFetchRector::class) @@ -9351,7 +9351,7 @@ Replaces defined classes by new ones. use Rector\Renaming\Rector\Name\RenameClassRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameClassRector::class) @@ -9394,7 +9394,7 @@ Replace constant by new ones use Rector\Renaming\Rector\ConstFetch\RenameConstantRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameConstantRector::class) @@ -9432,7 +9432,7 @@ Turns defined function call new one. use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameFunctionRector::class) @@ -9464,7 +9464,7 @@ use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameMethodRector::class) @@ -9494,7 +9494,7 @@ Replaces old namespace by new one. use Rector\Renaming\Rector\Namespace_\RenameNamespaceRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameNamespaceRector::class) @@ -9526,7 +9526,7 @@ use Rector\Renaming\Rector\PropertyFetch\RenamePropertyRector; use Rector\Renaming\ValueObject\RenameProperty; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenamePropertyRector::class) @@ -9556,7 +9556,7 @@ use Rector\Renaming\Rector\StaticCall\RenameStaticMethodRector; use Rector\Renaming\ValueObject\RenameStaticMethod; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameStaticMethodRector::class) @@ -9585,7 +9585,7 @@ Change string value use Rector\Renaming\Rector\String_\RenameStringRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RenameStringRector::class) @@ -9625,7 +9625,7 @@ use Rector\Restoration\Rector\Namespace_\CompleteImportForPartialAnnotationRecto use Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(CompleteImportForPartialAnnotationRector::class) @@ -9741,7 +9741,7 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(BooleanInBooleanNotRuleFixerRector::class) @@ -9782,7 +9782,7 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(BooleanInIfConditionRuleFixerRector::class) @@ -9823,7 +9823,7 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\BooleansInConditi use Rector\Strict\Rector\Ternary\BooleanInTernaryOperatorRuleFixerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(BooleanInTernaryOperatorRuleFixerRector::class) @@ -9860,7 +9860,7 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\DisallowedConstru use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DisallowedEmptyRuleFixerRector::class) @@ -9897,7 +9897,7 @@ Fixer for PHPStan reports by strict type rule - "PHPStan\Rules\DisallowedConstru use Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DisallowedShortTernaryRuleFixerRector::class) @@ -9936,7 +9936,7 @@ Add the `AllowDynamicProperties` attribute to all classes use Rector\Transform\Rector\Class_\AddAllowDynamicPropertiesAttributeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddAllowDynamicPropertiesAttributeRector::class) @@ -9969,7 +9969,7 @@ Add interface by used trait use Rector\Transform\Rector\Class_\AddInterfaceByTraitRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddInterfaceByTraitRector::class) @@ -10004,7 +10004,7 @@ use Rector\Transform\Rector\FuncCall\ArgumentFuncCallToMethodCallRector; use Rector\Transform\ValueObject\ArgumentFuncCallToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ArgumentFuncCallToMethodCallRector::class) @@ -10052,7 +10052,7 @@ use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector; use Rector\Transform\ValueObject\AttributeKeyToClassConstFetch; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AttributeKeyToClassConstFetchRector::class) @@ -10093,7 +10093,7 @@ use Rector\Transform\Rector\MethodCall\CallableInMethodCallToVariableRector; use Rector\Transform\ValueObject\CallableInMethodCallToVariable; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(CallableInMethodCallToVariableRector::class) @@ -10162,7 +10162,7 @@ use Rector\Transform\Rector\Assign\DimFetchAssignToMethodCallRector; use Rector\Transform\ValueObject\DimFetchAssignToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(DimFetchAssignToMethodCallRector::class) @@ -10208,7 +10208,7 @@ use Rector\Transform\Rector\FunctionLike\FileGetContentsAndJsonDecodeToStaticCal use Rector\Transform\ValueObject\StaticCallRecipe; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FileGetContentsAndJsonDecodeToStaticCallRector::class) @@ -10244,7 +10244,7 @@ Changes use of function calls to use constants use Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FuncCallToConstFetchRector::class) @@ -10282,7 +10282,7 @@ use Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector; use Rector\Transform\ValueObject\FuncCallToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FuncCallToMethodCallRector::class) @@ -10327,7 +10327,7 @@ Change configured function calls to new Instance use Rector\Transform\Rector\FuncCall\FuncCallToNewRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FuncCallToNewRector::class) @@ -10365,7 +10365,7 @@ use Rector\Transform\Rector\FuncCall\FuncCallToStaticCallRector; use Rector\Transform\ValueObject\FuncCallToStaticCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(FuncCallToStaticCallRector::class) @@ -10395,7 +10395,7 @@ use Rector\Transform\Rector\Assign\GetAndSetToMethodCallRector; use Rector\Transform\ValueObject\GetAndSetToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(GetAndSetToMethodCallRector::class) @@ -10425,7 +10425,7 @@ Merges old interface to a new one, that already has its methods use Rector\Transform\Rector\Class_\MergeInterfacesRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(MergeInterfacesRector::class) @@ -10459,7 +10459,7 @@ use Rector\Transform\Rector\MethodCall\MethodCallToAnotherMethodCallWithArgument use Rector\Transform\ValueObject\MethodCallToAnotherMethodCallWithArguments; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(MethodCallToAnotherMethodCallWithArgumentsRector::class) @@ -10494,7 +10494,7 @@ use Rector\Transform\Rector\MethodCall\MethodCallToMethodCallRector; use Rector\Transform\ValueObject\MethodCallToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(MethodCallToMethodCallRector::class) @@ -10535,7 +10535,7 @@ Turns method call `"$this->something()"` to property fetch "$this->something" use Rector\Transform\Rector\MethodCall\MethodCallToPropertyFetchRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(MethodCallToPropertyFetchRector::class) @@ -10573,7 +10573,7 @@ use Rector\Transform\Rector\MethodCall\MethodCallToStaticCallRector; use Rector\Transform\ValueObject\MethodCallToStaticCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(MethodCallToStaticCallRector::class) @@ -10616,7 +10616,7 @@ use Rector\Transform\Rector\New_\NewArgToMethodCallRector; use Rector\Transform\ValueObject\NewArgToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(NewArgToMethodCallRector::class) @@ -10652,7 +10652,7 @@ Change defined new type to constructor injection use Rector\Transform\Rector\New_\NewToConstructorInjectionRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(NewToConstructorInjectionRector::class) @@ -10699,7 +10699,7 @@ use Rector\Transform\Rector\New_\NewToMethodCallRector; use Rector\Transform\ValueObject\NewToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(NewToMethodCallRector::class) @@ -10739,7 +10739,7 @@ use Rector\Transform\Rector\New_\NewToStaticCallRector; use Rector\Transform\ValueObject\NewToStaticCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(NewToStaticCallRector::class) @@ -10775,7 +10775,7 @@ use Rector\Transform\Rector\Class_\ParentClassToTraitsRector; use Rector\Transform\ValueObject\ParentClassToTraits; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ParentClassToTraitsRector::class) @@ -10808,7 +10808,7 @@ use Rector\Transform\Rector\Assign\PropertyAssignToMethodCallRector; use Rector\Transform\ValueObject\PropertyAssignToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(PropertyAssignToMethodCallRector::class) @@ -10839,7 +10839,7 @@ use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector; use Rector\Transform\ValueObject\PropertyFetchToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(PropertyFetchToMethodCallRector::class) @@ -10888,7 +10888,7 @@ Remove the `AllowDynamicProperties` attribute from all classes use Rector\Transform\Rector\Class_\RemoveAllowDynamicPropertiesAttributeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(RemoveAllowDynamicPropertiesAttributeRector::class) @@ -10922,7 +10922,7 @@ use Rector\Transform\Rector\MethodCall\ReplaceParentCallByPropertyCallRector; use Rector\Transform\ValueObject\ReplaceParentCallByPropertyCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReplaceParentCallByPropertyCallRector::class) @@ -10957,7 +10957,7 @@ Add #[\ReturnTypeWillChange] attribute to configured instanceof class with metho use Rector\Transform\Rector\ClassMethod\ReturnTypeWillChangeRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ReturnTypeWillChangeRector::class) @@ -10994,7 +10994,7 @@ use Rector\Transform\Rector\MethodCall\ServiceGetterToConstructorInjectionRector use Rector\Transform\ValueObject\ServiceGetterToConstructorInjection; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ServiceGetterToConstructorInjectionRector::class) @@ -11063,7 +11063,7 @@ use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; use Rector\Transform\ValueObject\StaticCallToFuncCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(StaticCallToFuncCallRector::class) @@ -11093,7 +11093,7 @@ use Rector\Transform\Rector\StaticCall\StaticCallToMethodCallRector; use Rector\Transform\ValueObject\StaticCallToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(StaticCallToMethodCallRector::class) @@ -11149,7 +11149,7 @@ use Rector\Transform\Rector\StaticCall\StaticCallToNewRector; use Rector\Transform\ValueObject\StaticCallToNew; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(StaticCallToNewRector::class) @@ -11185,7 +11185,7 @@ use Rector\Transform\Rector\String_\StringToClassConstantRector; use Rector\Transform\ValueObject\StringToClassConstant; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(StringToClassConstantRector::class) @@ -11220,7 +11220,7 @@ Turns defined code uses of `"__toString()"` method to specific method calls. use Rector\Transform\Rector\String_\ToStringToMethodCallRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ToStringToMethodCallRector::class) @@ -11255,7 +11255,7 @@ use Rector\Transform\Rector\Isset_\UnsetAndIssetToMethodCallRector; use Rector\Transform\ValueObject\UnsetAndIssetToMethodCall; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(UnsetAndIssetToMethodCallRector::class) @@ -11288,7 +11288,7 @@ use Rector\Transform\Rector\ClassMethod\WrapReturnRector; use Rector\Transform\ValueObject\WrapReturn; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(WrapReturnRector::class) @@ -11423,7 +11423,7 @@ use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector; use Rector\TypeDeclaration\ValueObject\AddParamTypeDeclaration; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddParamTypeDeclarationRector::class) @@ -11459,7 +11459,7 @@ use Rector\TypeDeclaration\Rector\Property\AddPropertyTypeDeclarationRector; use Rector\TypeDeclaration\ValueObject\AddPropertyTypeDeclaration; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddPropertyTypeDeclarationRector::class) @@ -11494,7 +11494,7 @@ use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector; use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddReturnTypeDeclarationRector::class) @@ -11530,7 +11530,7 @@ Add return type void to function like without any return use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(AddVoidReturnTypeWhereNoReturnRector::class) @@ -11964,7 +11964,7 @@ use Rector\Visibility\Rector\ClassConst\ChangeConstantVisibilityRector; use Rector\Visibility\ValueObject\ChangeConstantVisibility; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ChangeConstantVisibilityRector::class) @@ -12002,7 +12002,7 @@ use Rector\Visibility\Rector\ClassMethod\ChangeMethodVisibilityRector; use Rector\Visibility\ValueObject\ChangeMethodVisibility; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { +return static function (\Rector\Config\RectorConfig $containerConfigurator): void { $services = $containerConfigurator->services(); $services->set(ChangeMethodVisibilityRector::class) diff --git a/docs/static_reflection_and_autoload.md b/docs/static_reflection_and_autoload.md index 2434f3d4405..26c22a931a0 100644 --- a/docs/static_reflection_and_autoload.md +++ b/docs/static_reflection_and_autoload.md @@ -10,13 +10,11 @@ Do you want to know more about it? Continue here: - [Zero Config Analysis with Static Reflection](https://phpstan.org/blog/zero-config-analysis-with-static-reflection) - from PHPStan ```php -// rector.php - use Rector\Core\Configuration\Option; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Rector\Config\RectorConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); // Rector is using static reflection to load code without running it - see https://phpstan.org/blog/zero-config-analysis-with-static-reflection $parameters->set(Option::AUTOLOAD_PATHS, [ @@ -32,13 +30,12 @@ return static function (ContainerConfigurator $containerConfigurator): void { Do you need to include constants, class aliases or custom autoloader? Use `BOOTSTRAP_FILES` parameter: ```php -// rector.php - +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::BOOTSTRAP_FILES, [ __DIR__ . '/constants.php', diff --git a/e2e/attributes/rector.php b/e2e/attributes/rector.php index f2ea9e04f5d..b3f02dffe15 100644 --- a/e2e/attributes/rector.php +++ b/e2e/attributes/rector.php @@ -2,15 +2,15 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Symfony\Set\SymfonySetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->import(SymfonySetList::SYMFONY_52); +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->import(SymfonySetList::SYMFONY_52); - $parameters = $containerConfigurator->parameters(); + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80); $parameters->set(Option::SOURCE, [__DIR__ . '/src']); }; diff --git a/e2e/define-constant/rector.php b/e2e/define-constant/rector.php index 50cfd0ce75f..1422ef31a4b 100644 --- a/e2e/define-constant/rector.php +++ b/e2e/define-constant/rector.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__ . '/src']); }; diff --git a/e2e/dont-execute-code/rector.php b/e2e/dont-execute-code/rector.php index bde91796b2c..80b957733ae 100644 --- a/e2e/dont-execute-code/rector.php +++ b/e2e/dont-execute-code/rector.php @@ -2,13 +2,13 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__.'/src']); - $containerConfigurator->import(SetList::PHP_53); + $rectorConfig->import(SetList::PHP_53); }; diff --git a/e2e/finalize/rector.php b/e2e/finalize/rector.php index 290907417b1..fc2e8cae58a 100644 --- a/e2e/finalize/rector.php +++ b/e2e/finalize/rector.php @@ -2,10 +2,10 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $services = $containerConfigurator->services(); +return static function (RectorConfig $rectorConfig): void { + $services = $rectorConfig->services(); $services->set(FinalizeClassesWithoutChildrenRector::class); }; diff --git a/e2e/global-install/rector.php b/e2e/global-install/rector.php index f62e0c56e64..1e51cf196d9 100644 --- a/e2e/global-install/rector.php +++ b/e2e/global-install/rector.php @@ -3,13 +3,13 @@ declare(strict_types=1); use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__ . '/src/']); - $services = $containerConfigurator->services(); + $services = $rectorConfig->services(); $services->set(MakeInheritedMethodVisibilitySameAsParentRector::class); }; diff --git a/e2e/parse-match-class-on-php74/rector.php b/e2e/parse-match-class-on-php74/rector.php index 68b98378604..ce8d5cd747b 100644 --- a/e2e/parse-match-class-on-php74/rector.php +++ b/e2e/parse-match-class-on-php74/rector.php @@ -2,13 +2,14 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__.'/src']); - $containerConfigurator->import(SetList::DEAD_CODE); + $rectorConfig->import(SetList::DEAD_CODE); }; diff --git a/e2e/parse-php7-code/rector.php b/e2e/parse-php7-code/rector.php index bde91796b2c..4ed6590b494 100644 --- a/e2e/parse-php7-code/rector.php +++ b/e2e/parse-php7-code/rector.php @@ -2,13 +2,14 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__.'/src']); - $containerConfigurator->import(SetList::PHP_53); + $rectorConfig->import(SetList::PHP_53); }; diff --git a/e2e/parse-php8-code/rector.php b/e2e/parse-php8-code/rector.php index bde91796b2c..80b957733ae 100644 --- a/e2e/parse-php8-code/rector.php +++ b/e2e/parse-php8-code/rector.php @@ -2,13 +2,13 @@ declare(strict_types=1); +use Rector\Config\RectorConfig; use Rector\Core\Configuration\Option; use Rector\Set\ValueObject\SetList; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); +return static function (RectorConfig $rectorConfig): void { + $parameters = $rectorConfig->parameters(); $parameters->set(Option::PATHS, [__DIR__.'/src']); - $containerConfigurator->import(SetList::PHP_53); + $rectorConfig->import(SetList::PHP_53); }; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index c9a1a64936a..4be533db840 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = 'ccbeeebb511d3b6abc2ada84ca08cf1bfb6b0ba1'; + public const PACKAGE_VERSION = '8d92c466fdd6a002ea89b5356ca99def77998bfe'; /** * @var string */ - public const RELEASE_DATE = '2022-04-12 10:53:33'; + public const RELEASE_DATE = '2022-04-12 13:46:07'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20220412\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/vendor/autoload.php b/vendor/autoload.php index e32d8bac6c7..c8e60151875 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f::getLoader(); +return ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6a5d9c0d93a..5589de905b5 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f +class ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequiref9c80f7c11372ec269434c8ec46e921f($fileIdentifier, $file); + composerRequirecda7bf22fda9d1f62af82363e70b9afc($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f * @param string $file * @return void */ -function composerRequiref9c80f7c11372ec269434c8ec46e921f($fileIdentifier, $file) +function composerRequirecda7bf22fda9d1f62af82363e70b9afc($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ae13319272a..440289c6daf 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f +class ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc { public static $files = array ( '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', @@ -3862,9 +3862,9 @@ class ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf9c80f7c11372ec269434c8ec46e921f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitcda7bf22fda9d1f62af82363e70b9afc::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index bd7fde34b50..e94327b06ea 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php'; if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) { spl_autoload_call('RectorPrefix20220412\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f', false) && !interface_exists('ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f', false) && !trait_exists('ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f', false)) { - spl_autoload_call('RectorPrefix20220412\ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f'); +if (!class_exists('ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc', false) && !interface_exists('ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc', false) && !trait_exists('ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc', false)) { + spl_autoload_call('RectorPrefix20220412\ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc'); } if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) { spl_autoload_call('RectorPrefix20220412\Helmich\TypoScriptParser\Parser\AST\Statement'); @@ -59,9 +59,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20220412\print_node(...func_get_args()); } } -if (!function_exists('composerRequiref9c80f7c11372ec269434c8ec46e921f')) { - function composerRequiref9c80f7c11372ec269434c8ec46e921f() { - return \RectorPrefix20220412\composerRequiref9c80f7c11372ec269434c8ec46e921f(...func_get_args()); +if (!function_exists('composerRequirecda7bf22fda9d1f62af82363e70b9afc')) { + function composerRequirecda7bf22fda9d1f62af82363e70b9afc() { + return \RectorPrefix20220412\composerRequirecda7bf22fda9d1f62af82363e70b9afc(...func_get_args()); } } if (!function_exists('scanPath')) {