Updated Rector to commit 8d92c466fdd6a002ea89b5356ca99def77998bfe

8d92c466fd [DX] Use RectorConfig in configs (#2063)
This commit is contained in:
Tomas Votruba 2022-04-12 11:52:08 +00:00
parent ab464c9742
commit 0dc28df936
92 changed files with 482 additions and 541 deletions

View File

@ -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');
};
```

View File

@ -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');
};

View File

@ -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']);

View File

@ -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',

View File

@ -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);

View File

@ -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);

View File

@ -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);
};

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);
};

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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',

View File

@ -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);

View File

@ -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);

View File

@ -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'),

View File

@ -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);
};

View File

@ -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);
};

File diff suppressed because one or more lines are too long

View File

@ -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')]);

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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')]);
};

View File

@ -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

View File

@ -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);

View File

@ -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([

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);
};

View File

@ -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);

View File

@ -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);

View File

@ -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);
};

View File

@ -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'),
]);
};
```

View File

@ -146,17 +146,11 @@ composer dump-autoload
## 2. Register It
```php
<?php
// rector.php
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Utils\Rector\Rector\MyFirstRector;
use Rector\Config\RectorConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(MyFirstRector::class);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(MyFirstRector::class);
};
```

View File

@ -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
<?php
// rector.php
use Rector\PHPUnit\Rector\ClassMethod\ExceptionAnnotationRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Config\RectorConfig
use Rector\Renaming\ValueObject\MethodCallRename;
declare(strict_types=1);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->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'),
]);
};
```

View File

@ -5,20 +5,12 @@ Rector rules that implement `Rector\Core\Contract\Rector\ConfigurableRectorInter
Typical example is `Rector\Renaming\Rector\Name\RenameClassRector`:
```php
<?php
// rector.php
declare(strict_types=1);
use Rector\Renaming\Rector\Name\RenameClassRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(RenameClassRector::class)
->configure([
'App\SomeOldClass' => 'App\SomeNewClass',
]);
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(RenameClassRector::class, [
'App\SomeOldClass' => 'App\SomeNewClass',
]);
};
```

View File

@ -62,14 +62,12 @@ final class BoldStatementFileProcessor implements FileProcessorInterface
Now register your FileProcessor in your configuration (actually in the container):
```php
<?php
// rector.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use MyVendor\MyPackage\FileProcessor\BoldStatementFileProcessor;
use Rector\Config\RectorConfig
return static function (ContainerConfigurator $containerConfigurator): void {
return static function (RectorConfig $rectorConfig): void {
// [...]
$services = $containerConfigurator->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
<?php
// rector.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use MyVendor\MyPackage\FileProcessor\BoldStatementFileProcessor;
use MyVendor\MyPackage\FileProcessor\Rector\BoldStatementMakeAmericaGreatAgainRector;
use Rector\Config\RectorConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
return static function (RectorConfig $rectorConfig): void {
// [...]
$services = $containerConfigurator->services();
$services = $rectorConfig->services();
$services->set(BoldStatementFileProcessor::class);
$services->set(BoldStatementMakeAmericaGreatAgainRector::class);
$rectorConfig->rule(BoldStatementMakeAmericaGreatAgainRector::class);
};
```

View File

@ -3,21 +3,12 @@
## Preferred Way: Config
```php
<?php
// rector.php
declare(strict_types=1);
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\Core\Configuration\Option;
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 {
// is there a file you need to skip?
$parameters->set(Option::SKIP, [
$rectorConfig->skip([
// single file
__DIR__ . '/src/ComplicatedFile.php',
// or directory

View File

@ -20,37 +20,27 @@ Now, you can register your custom `SetList`'s constant via import from `$contain
```php
<?php
// rector.php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use App\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->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
<?php
// rector.php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\DowngradeSetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Rector\Config\RectorConfig;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->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']);
};
```

View File

@ -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',

View File

@ -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>::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 "<Smart>Object" where <Smart> 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)

View File

@ -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',

View File

@ -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']);
};

View File

@ -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']);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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);
};

View File

@ -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__);

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf9c80f7c11372ec269434c8ec46e921f::getLoader();
return ComposerAutoloaderInitcda7bf22fda9d1f62af82363e70b9afc::getLoader();

View File

@ -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;

View File

@ -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);
}

View File

@ -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')) {