diff --git a/config/set/action-injection-to-constructor-injection.php b/config/set/action-injection-to-constructor-injection.php index 37f0c6743a3..96f52f960cb 100644 --- a/config/set/action-injection-to-constructor-injection.php +++ b/config/set/action-injection-to-constructor-injection.php @@ -6,6 +6,5 @@ namespace RectorPrefix20220420; use Rector\Config\RectorConfig; use Rector\DependencyInjection\Rector\Class_\ActionInjectionToConstructorInjectionRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { - $services = $rectorConfig->services(); - $services->set(\Rector\DependencyInjection\Rector\Class_\ActionInjectionToConstructorInjectionRector::class); + $rectorConfig->rule(\Rector\DependencyInjection\Rector\Class_\ActionInjectionToConstructorInjectionRector::class); }; diff --git a/config/set/code-quality.php b/config/set/code-quality.php index 6d761c7d326..95673b3d5cb 100644 --- a/config/set/code-quality.php +++ b/config/set/code-quality.php @@ -79,63 +79,62 @@ use Rector\Php52\Rector\Property\VarToPublicPropertyRector; use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; 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); - $services->set(\Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector::class); - $services->set(\Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SimplifyFuncGetArgsCountRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SimplifyInArrayValuesRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\SimplifyArraySearchRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class); - $services->set(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class); - $services->set(\Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class); - $services->set(\Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector::class); - $services->set(\Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector::class); - $services->set(\Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector::class); - $services->set(\Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector::class); - $services->set(\Rector\CodeQuality\Rector\Concat\JoinStringConcatRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfIssetToNullCoalescingRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\CombineIfRector::class); - $services->set(\Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class); - $services->set(\Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector::class); - $services->set(\Rector\CodeQuality\Rector\LogicalAnd\AndAssignsToSeparateLinesRector::class); - $services->set(\Rector\CodeQuality\Rector\For_\ForToForeachRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class); - $services->set(\Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\StrlenZeroToIdenticalEmptyStringRector::class); - $services->set(\Rector\CodeQuality\Rector\FunctionLike\RemoveAlwaysTrueConditionSetInConstructorRector::class); - $services->set(\Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\ShortenElseIfRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector::class); - $services->set(\Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class); - $services->set(\Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class); - $services->set(\Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class); - $services->set(\Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class); - $services->set(\Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector::class); - $services->set(\Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector::class); - $services->set(\Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector::class); - $services->set(\Rector\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector::class); - $services->set(\Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class); - $services->set(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class)->configure([ + $rectorConfig->rule(\Rector\CodeQuality\Rector\Assign\CombinedAssignRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToCoalescingRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SimplifyFuncGetArgsCountRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SimplifyInArrayValuesRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\SimplifyArraySearchRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\SimplifyIfNotNullReturnRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class); + $rectorConfig->rule(\Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Concat\JoinStringConcatRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\SimplifyIfIssetToNullCoalescingRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\CombineIfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\LogicalAnd\AndAssignsToSeparateLinesRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\For_\ForToForeachRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\IsAWithStringWithThirdArgumentRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\StrlenZeroToIdenticalEmptyStringRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FunctionLike\RemoveAlwaysTrueConditionSetInConstructorRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\RemoveSoleValueSprintfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\ShortenElseIfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\AddPregQuoteDelimiterRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\ArrayMergeOfNonArraysToSimpleArrayRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\ArrayKeysAndInArrayToArrayKeyExistsRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Assign\SplitListAssignToSeparateLineRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Array_\ArrayThisCallToThisMethodCallRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class, [ 'split' => 'explode', 'join' => 'implode', 'sizeof' => 'count', @@ -160,22 +159,22 @@ return static function (\Rector\Config\RectorConfig $rectorConfig) : void { 'mbstrrpos' => 'mb_strrpos', 'mbsubstr' => 'mb_substr', ]); - $services->set(\Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector::class); - $services->set(\Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector::class); - $services->set(\Rector\Php52\Rector\Property\VarToPublicPropertyRector::class); - $services->set(\Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class); - $services->set(\Rector\CodeQuality\Rector\New_\NewStaticToNewSelfRector::class); - $services->set(\Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector::class); - $services->set(\Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector::class); - $services->set(\Rector\CodeQuality\Rector\Switch_\SingularSwitchToIfRector::class); - $services->set(\Rector\CodeQuality\Rector\If_\SimplifyIfNullableReturnRector::class); - $services->set(\Rector\CodeQuality\Rector\ClassMethod\NarrowUnionTypeDocRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector::class); - $services->set(\Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector::class); - $services->set(\Rector\CodeQuality\Rector\FuncCall\CallUserFuncWithArrowFunctionToInlineRector::class); - $services->set(\Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class); - $services->set(\Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class); - $services->set(\Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector::class); - $services->set(\Rector\CodeQuality\Rector\Do_\DoWhileBreakFalseToIfElseRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\SetTypeToCastRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector::class); + $rectorConfig->rule(\Rector\Php52\Rector\Property\VarToPublicPropertyRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\New_\NewStaticToNewSelfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Switch_\SingularSwitchToIfRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\If_\SimplifyIfNullableReturnRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\ClassMethod\NarrowUnionTypeDocRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FuncCall\CallUserFuncWithArrowFunctionToInlineRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\Do_\DoWhileBreakFalseToIfElseRector::class); }; diff --git a/config/set/coding-style.php b/config/set/coding-style.php index b4d0a50f9c2..0b4b338b6c8 100644 --- a/config/set/coding-style.php +++ b/config/set/coding-style.php @@ -33,33 +33,32 @@ use Rector\Config\RectorConfig; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector; 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); - $services->set(\Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector::class); - $services->set(\Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector::class); - $services->set(\Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassConst\SplitGroupedConstantsAndPropertiesRector::class); - $services->set(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class); - $services->set(\Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class); - $services->set(\Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector::class); - $services->set(\Rector\CodingStyle\Rector\Plus\UseIncrementAssignRector::class); - $services->set(\Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class); - $services->set(\Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class); - $services->set(\Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector::class); - $services->set(\Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector::class); - $services->set(\Rector\CodingStyle\Rector\Property\AddFalseDefaultToBoolPropertyRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector::class); - $services->set(\Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector::class); - $services->set(\Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector::class); - $services->set(\Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector::class)->configure(['php_sapi_name' => 'PHP_SAPI', 'pi' => 'M_PI']); - $services->set(\Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassMethod\RemoveDoubleUnderscoreInMethodNameRector::class); - $services->set(\Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class); - $services->set(\Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class); - $services->set(\Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Assign\PHPStormVarAnnotationRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\If_\NullableCompareToNullRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Ternary\TernaryConditionVariableAssignmentRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassConst\SplitGroupedConstantsAndPropertiesRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Plus\UseIncrementAssignRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Property\AddFalseDefaultToBoolPropertyRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector::class, ['php_sapi_name' => 'PHP_SAPI', 'pi' => 'M_PI']); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Use_\SeparateMultiUseImportsRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassMethod\RemoveDoubleUnderscoreInMethodNameRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class); + $rectorConfig->rule(\Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class); }; diff --git a/config/set/dead-code.php b/config/set/dead-code.php index 569c2f8a1ad..5829908bad4 100644 --- a/config/set/dead-code.php +++ b/config/set/dead-code.php @@ -51,52 +51,51 @@ use Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector; use Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector; use Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector; 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); - $services->set(\Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector::class); - $services->set(\Rector\DeadCode\Rector\Array_\RemoveDuplicatedArrayKeyRector::class); - $services->set(\Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector::class); - $services->set(\Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector::class); - $services->set(\Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector::class); - $services->set(\Rector\DeadCode\Rector\Expression\SimplifyMirrorAssignRector::class); - $services->set(\Rector\DeadCode\Rector\FunctionLike\RemoveOverriddenValuesRector::class); - $services->set(\Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector::class); - $services->set(\Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector::class); - $services->set(\Rector\DeadCode\Rector\FunctionLike\RemoveCodeAfterReturnRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector::class); - $services->set(\Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector::class); - $services->set(\Rector\DeadCode\Rector\For_\RemoveDeadContinueRector::class); - $services->set(\Rector\DeadCode\Rector\For_\RemoveDeadIfForeachForRector::class); - $services->set(\Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector::class); - $services->set(\Rector\DeadCode\Rector\Concat\RemoveConcatAutocastRector::class); - $services->set(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector::class); - $services->set(\Rector\DeadCode\Rector\BinaryOp\RemoveDuplicatedInstanceOfRector::class); - $services->set(\Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector::class); - $services->set(\Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector::class); - $services->set(\Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector::class); - $services->set(\Rector\DeadCode\Rector\If_\SimplifyIfElseWithSameContentRector::class); - $services->set(\Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector::class); - $services->set(\Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector::class); - $services->set(\Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector::class); - $services->set(\Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class); - $services->set(\Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector::class); - $services->set(\Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector::class); - $services->set(\Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector::class); - $services->set(\Rector\DeadCode\Rector\Return_\RemoveDeadConditionAboveReturnRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector::class); - $services->set(\Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector::class); - $services->set(\Rector\DeadCode\Rector\For_\RemoveDeadLoopRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParamInRequiredAutowireRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Cast\RecastingRemovalRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Expression\RemoveDeadStmtRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Array_\RemoveDuplicatedArrayKeyRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveEmptyClassMethodRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Expression\SimplifyMirrorAssignRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\FunctionLike\RemoveOverriddenValuesRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassConst\RemoveUnusedPrivateClassConstantRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\FunctionLike\RemoveCodeAfterReturnRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveDeadConstructorRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\FunctionLike\RemoveDeadReturnRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\For_\RemoveDeadContinueRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\For_\RemoveDeadIfForeachForRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\BooleanAnd\RemoveAndTrueRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Concat\RemoveConcatAutocastRector::class); + $rectorConfig->rule(\Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveDelegatingParentCallRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\BinaryOp\RemoveDuplicatedInstanceOfRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\SimplifyIfElseWithSameContentRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector::class); + $rectorConfig->rule(\Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\FunctionLike\RemoveDuplicatedIfReturnRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Return_\RemoveDeadConditionAboveReturnRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\For_\RemoveDeadLoopRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParamInRequiredAutowireRector::class); // docblock - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector::class); - $services->set(\Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class); - $services->set(\Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\ClassMethod\RemoveLastReturnRector::class); }; diff --git a/config/set/downgrade-php53.php b/config/set/downgrade-php53.php index feb7af69b99..1c6afe27670 100644 --- a/config/set/downgrade-php53.php +++ b/config/set/downgrade-php53.php @@ -8,6 +8,5 @@ use Rector\Core\ValueObject\PhpVersion; use Rector\DowngradePhp53\Rector\Dir\DirConstToFileConstRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_52); - $services = $rectorConfig->services(); - $services->set(\Rector\DowngradePhp53\Rector\Dir\DirConstToFileConstRector::class); + $rectorConfig->rule(\Rector\DowngradePhp53\Rector\Dir\DirConstToFileConstRector::class); }; diff --git a/config/set/downgrade-php54.php b/config/set/downgrade-php54.php index 789f7224462..47c9c3fac79 100644 --- a/config/set/downgrade-php54.php +++ b/config/set/downgrade-php54.php @@ -14,12 +14,11 @@ use Rector\DowngradePhp54\Rector\LNumber\DowngradeBinaryNotationRector; use Rector\DowngradePhp54\Rector\MethodCall\DowngradeInstanceMethodCallRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_53); - $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); - $services->set(\Rector\DowngradePhp54\Rector\FunctionLike\DowngradeCallableTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp54\Rector\LNumber\DowngradeBinaryNotationRector::class); - $services->set(\Rector\DowngradePhp54\Rector\MethodCall\DowngradeInstanceMethodCallRector::class); - $services->set(\Rector\DowngradePhp54\Rector\Closure\DowngradeThisInClosureRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\Array_\ShortArrayToLongArrayRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\Closure\DowngradeStaticClosureRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\FuncCall\DowngradeIndirectCallByArrayRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\FunctionLike\DowngradeCallableTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\LNumber\DowngradeBinaryNotationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\MethodCall\DowngradeInstanceMethodCallRector::class); + $rectorConfig->rule(\Rector\DowngradePhp54\Rector\Closure\DowngradeThisInClosureRector::class); }; diff --git a/config/set/downgrade-php55.php b/config/set/downgrade-php55.php index 9f7654dcd0a..8a2da7eb36e 100644 --- a/config/set/downgrade-php55.php +++ b/config/set/downgrade-php55.php @@ -11,9 +11,8 @@ use Rector\DowngradePhp55\Rector\FuncCall\DowngradeBoolvalRector; use Rector\DowngradePhp55\Rector\Isset_\DowngradeArbitraryExpressionArgsToEmptyAndIssetRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_54); - $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); - $services->set(\Rector\DowngradePhp55\Rector\Isset_\DowngradeArbitraryExpressionArgsToEmptyAndIssetRector::class); + $rectorConfig->rule(\Rector\DowngradePhp55\Rector\ClassConstFetch\DowngradeClassConstantToStringRector::class); + $rectorConfig->rule(\Rector\DowngradePhp55\Rector\Foreach_\DowngradeForeachListRector::class); + $rectorConfig->rule(\Rector\DowngradePhp55\Rector\FuncCall\DowngradeBoolvalRector::class); + $rectorConfig->rule(\Rector\DowngradePhp55\Rector\Isset_\DowngradeArbitraryExpressionArgsToEmptyAndIssetRector::class); }; diff --git a/config/set/downgrade-php56.php b/config/set/downgrade-php56.php index a4ca9798f38..ad553c22dc4 100644 --- a/config/set/downgrade-php56.php +++ b/config/set/downgrade-php56.php @@ -12,10 +12,9 @@ use Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialOperatorRector; use Rector\DowngradePhp56\Rector\Use_\DowngradeUseFunctionRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_55); - $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); - $services->set(\Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialOperatorRector::class); - $services->set(\Rector\DowngradePhp56\Rector\FuncCall\DowngradeArrayFilterUseConstantRector::class); + $rectorConfig->rule(\Rector\DowngradePhp56\Rector\CallLike\DowngradeArgumentUnpackingRector::class); + $rectorConfig->rule(\Rector\DowngradePhp56\Rector\Use_\DowngradeUseFunctionRector::class); + $rectorConfig->rule(\Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialAssignmentOperatorRector::class); + $rectorConfig->rule(\Rector\DowngradePhp56\Rector\Pow\DowngradeExponentialOperatorRector::class); + $rectorConfig->rule(\Rector\DowngradePhp56\Rector\FuncCall\DowngradeArrayFilterUseConstantRector::class); }; diff --git a/config/set/downgrade-php70.php b/config/set/downgrade-php70.php index d46b992ae31..685fafd115e 100644 --- a/config/set/downgrade-php70.php +++ b/config/set/downgrade-php70.php @@ -26,24 +26,23 @@ use Rector\DowngradePhp70\Rector\String_\DowngradeGeneratedScalarTypesRector; use Rector\DowngradePhp70\Rector\TryCatch\DowngradeCatchThrowableRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_56); - $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); - $services->set(\Rector\DowngradePhp70\Rector\FunctionLike\DowngradeThrowableTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp70\Rector\Declare_\DowngradeStrictTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector::class); - $services->set(\Rector\DowngradePhp70\Rector\Coalesce\DowngradeNullCoalesceRector::class); - $services->set(\Rector\DowngradePhp70\Rector\Spaceship\DowngradeSpaceshipRector::class); - $services->set(\Rector\DowngradePhp70\Rector\Expression\DowngradeDefineArrayConstantRector::class); - $services->set(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeDirnameLevelsRector::class); - $services->set(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeSessionStartArrayOptionsRector::class); - $services->set(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeUncallableValueCallToCallUserFuncRector::class); - $services->set(\Rector\DowngradePhp70\Rector\GroupUse\SplitGroupedUseImportsRector::class); - $services->set(\Rector\DowngradePhp70\Rector\MethodCall\DowngradeClosureCallRector::class); - $services->set(\Rector\DowngradePhp70\Rector\String_\DowngradeGeneratedScalarTypesRector::class); - $services->set(\Rector\DowngradePhp70\Rector\ClassMethod\DowngradeParentTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp70\Rector\MethodCall\DowngradeMethodCallOnCloneRector::class); - $services->set(\Rector\DowngradePhp70\Rector\Expr\DowngradeUnnecessarilyParenthesizedExpressionRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\TryCatch\DowngradeCatchThrowableRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Instanceof_\DowngradeInstanceofThrowableRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\FunctionLike\DowngradeScalarTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\FunctionLike\DowngradeThrowableTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Declare_\DowngradeStrictTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Coalesce\DowngradeNullCoalesceRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Spaceship\DowngradeSpaceshipRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Expression\DowngradeDefineArrayConstantRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeDirnameLevelsRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeSessionStartArrayOptionsRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\FuncCall\DowngradeUncallableValueCallToCallUserFuncRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\GroupUse\SplitGroupedUseImportsRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\MethodCall\DowngradeClosureCallRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\String_\DowngradeGeneratedScalarTypesRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\ClassMethod\DowngradeParentTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\MethodCall\DowngradeMethodCallOnCloneRector::class); + $rectorConfig->rule(\Rector\DowngradePhp70\Rector\Expr\DowngradeUnnecessarilyParenthesizedExpressionRector::class); }; diff --git a/config/set/downgrade-php71.php b/config/set/downgrade-php71.php index 095b1d74649..7ab21159f20 100644 --- a/config/set/downgrade-php71.php +++ b/config/set/downgrade-php71.php @@ -18,16 +18,15 @@ use Rector\DowngradePhp71\Rector\String_\DowngradeNegativeStringOffsetToStrlenRe use Rector\DowngradePhp71\Rector\TryCatch\DowngradePipeToMultiCatchExceptionRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_70); - $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); - $services->set(\Rector\DowngradePhp71\Rector\TryCatch\DowngradePipeToMultiCatchExceptionRector::class); - $services->set(\Rector\DowngradePhp71\Rector\Array_\SymmetricArrayDestructuringToListRector::class); - $services->set(\Rector\DowngradePhp71\Rector\String_\DowngradeNegativeStringOffsetToStrlenRector::class); - $services->set(\Rector\DowngradePhp71\Rector\List_\DowngradeKeysInListRector::class); - $services->set(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeIterablePseudoTypeDeclarationRector::class); - $services->set(\Rector\DowngradePhp71\Rector\FuncCall\DowngradeIsIterableRector::class); - $services->set(\Rector\DowngradePhp71\Rector\StaticCall\DowngradeClosureFromCallableRector::class); - $services->set(\Rector\DowngradePhp71\Rector\ConstFetch\DowngradePhp71JsonConstRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeNullableTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeVoidTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\ClassConst\DowngradeClassConstantVisibilityRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\TryCatch\DowngradePipeToMultiCatchExceptionRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\Array_\SymmetricArrayDestructuringToListRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\String_\DowngradeNegativeStringOffsetToStrlenRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\List_\DowngradeKeysInListRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\FunctionLike\DowngradeIterablePseudoTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\FuncCall\DowngradeIsIterableRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\StaticCall\DowngradeClosureFromCallableRector::class); + $rectorConfig->rule(\Rector\DowngradePhp71\Rector\ConstFetch\DowngradePhp71JsonConstRector::class); }; diff --git a/config/set/downgrade-php72.php b/config/set/downgrade-php72.php index 324c1afca78..5346fda3820 100644 --- a/config/set/downgrade-php72.php +++ b/config/set/downgrade-php72.php @@ -13,11 +13,10 @@ use Rector\DowngradePhp72\Rector\FuncCall\DowngradeStreamIsattyRector; use Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_71); - $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); - $services->set(\Rector\DowngradePhp72\Rector\FuncCall\DowngradeStreamIsattyRector::class); - $services->set(\Rector\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgRector::class); - $services->set(\Rector\DowngradePhp72\Rector\ConstFetch\DowngradePhp72JsonConstRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\FuncCall\DowngradePregUnmatchedAsNullConstantRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\FuncCall\DowngradeStreamIsattyRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgRector::class); + $rectorConfig->rule(\Rector\DowngradePhp72\Rector\ConstFetch\DowngradePhp72JsonConstRector::class); }; diff --git a/config/set/downgrade-php81.php b/config/set/downgrade-php81.php index fa63382fac9..b364953fd5a 100644 --- a/config/set/downgrade-php81.php +++ b/config/set/downgrade-php81.php @@ -16,14 +16,13 @@ use Rector\DowngradePhp81\Rector\Instanceof_\DowngradePhp81ResourceReturnToObjec use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { $rectorConfig->phpVersion(\Rector\Core\ValueObject\PhpVersion::PHP_80); - $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); - $services->set(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradePureIntersectionTypeRector::class); - $services->set(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradeNewInInitializerRector::class); - $services->set(\Rector\DowngradePhp81\Rector\Instanceof_\DowngradePhp81ResourceReturnToObjectRector::class); - $services->set(\Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector::class); - $services->set(\Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector::class); - $services->set(\Rector\DowngradePhp81\Rector\FuncCall\DowngradeArrayIsListRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\ClassConst\DowngradeFinalizePublicClassConstantRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\FuncCall\DowngradeFirstClassCallableSyntaxRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradeNeverTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradePureIntersectionTypeRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\FunctionLike\DowngradeNewInInitializerRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\Instanceof_\DowngradePhp81ResourceReturnToObjectRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector::class); + $rectorConfig->rule(\Rector\DowngradePhp81\Rector\FuncCall\DowngradeArrayIsListRector::class); }; diff --git a/config/set/early-return.php b/config/set/early-return.php index 78cdcbcb866..8564b6193b6 100644 --- a/config/set/early-return.php +++ b/config/set/early-return.php @@ -16,16 +16,15 @@ use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; 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); - $services->set(\Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector::class); - $services->set(\Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector::class); - $services->set(\Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector::class); - $services->set(\Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector::class); - $services->set(\Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector::class); - $services->set(\Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector::class); - $services->set(\Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector::class); - $services->set(\Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\ChangeIfElseValueAssignToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\ChangeOrIfReturnToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector::class); + $rectorConfig->rule(\Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector::class); }; diff --git a/config/set/flysystem-20.php b/config/set/flysystem-20.php index e7e6c827bb0..6fe011f19e5 100644 --- a/config/set/flysystem-20.php +++ b/config/set/flysystem-20.php @@ -7,8 +7,7 @@ use Rector\Config\RectorConfig; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\ValueObject\MethodCallRename; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { - $services = $rectorConfig->services(); - $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([ + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class, [ // Rename is now move, specific for files. new \Rector\Renaming\ValueObject\MethodCallRename('League\\Flysystem\\FilesystemInterface', 'rename', 'move'), // No arbitrary abbreviations diff --git a/config/set/framework-extra-bundle-40.php b/config/set/framework-extra-bundle-40.php index c6fca3bea0a..ed6f8ce4fd3 100644 --- a/config/set/framework-extra-bundle-40.php +++ b/config/set/framework-extra-bundle-40.php @@ -7,7 +7,6 @@ use Rector\Config\RectorConfig; use Rector\Symfony\Rector\ClassMethod\RemoveServiceFromSensioRouteRector; use Rector\Symfony\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector; 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); + $rectorConfig->rule(\Rector\Symfony\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector::class); + $rectorConfig->rule(\Rector\Symfony\Rector\ClassMethod\RemoveServiceFromSensioRouteRector::class); }; diff --git a/config/set/framework-extra-bundle-50.php b/config/set/framework-extra-bundle-50.php index 6c0de8715b7..79f9f010ed0 100644 --- a/config/set/framework-extra-bundle-50.php +++ b/config/set/framework-extra-bundle-50.php @@ -6,6 +6,5 @@ namespace RectorPrefix20220420; use Rector\Config\RectorConfig; use Rector\Symfony\Rector\ClassMethod\TemplateAnnotationToThisRenderRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { - $services = $rectorConfig->services(); - $services->set(\Rector\Symfony\Rector\ClassMethod\TemplateAnnotationToThisRenderRector::class); + $rectorConfig->rule(\Rector\Symfony\Rector\ClassMethod\TemplateAnnotationToThisRenderRector::class); }; diff --git a/config/set/gmagick_to_imagick.php b/config/set/gmagick_to_imagick.php index 35f035e8417..52cb8871c82 100644 --- a/config/set/gmagick_to_imagick.php +++ b/config/set/gmagick_to_imagick.php @@ -9,7 +9,6 @@ use Rector\Renaming\Rector\Name\RenameClassRector; use Rector\Renaming\ValueObject\MethodCallRename; # https://www.php.net/manual/en/book.gmagick.php → https://www.php.net/manual/en/book.imagick.php return static function (\Rector\Config\RectorConfig $rectorConfig) : void { - $services = $rectorConfig->services(); - $services->set(\Rector\Renaming\Rector\Name\RenameClassRector::class)->configure(['Gmagick' => 'Imagick', 'GmagickPixel' => 'ImagickPixel']); - $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addimage', 'addImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addnoiseimage', 'addNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'annotateimage', 'annotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'blurimage', 'blurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'borderimage', 'borderImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'charcoalimage', 'charcoalImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'chopimage', 'chopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'commentimage', 'commentImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'compositeimage', 'compositeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropimage', 'cropImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropthumbnailimage', 'cropThumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cyclecolormapimage', 'cycleColormapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'deconstructimages', 'deconstructImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'despeckleimage', 'despeckleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'drawimage', 'drawImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'edgeimage', 'edgeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'embossimage', 'embossImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'enhanceimage', 'enhanceImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'equalizeimage', 'equalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flipimage', 'flipImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flopimage', 'flopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'frameimage', 'frameImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'gammaimage', 'gammaImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getcopyright', 'getCopyright'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getfilename', 'getFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebackgroundcolor', 'getImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageblueprimary', 'getImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebordercolor', 'getImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagechanneldepth', 'getImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolors', 'getImageColors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolorspace', 'getImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecompose', 'getImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedelay', 'getImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedepth', 'getImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedispose', 'getImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageextrema', 'getImageExtrema'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagefilename', 'getImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageformat', 'getImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegamma', 'getImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegreenprimary', 'getImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageheight', 'getImageHeight'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagehistogram', 'getImageHistogram'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageindex', 'getImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageinterlacescheme', 'getImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageiterations', 'getImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagematte', 'getImageMatte'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagemattecolor', 'getImageMatteColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageprofile', 'getImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageredprimary', 'getImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagerenderingintent', 'getImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageresolution', 'getImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagescene', 'getImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagesignature', 'getImageSignature'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagetype', 'getImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageunits', 'getImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewhitepoint', 'getImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewidth', 'getImageWidth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getpackagename', 'getPackageName'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getquantumdepth', 'getQuantumDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getreleasedate', 'getReleaseDate'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsamplingfactors', 'getSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsize', 'getSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getversion', 'getVersion'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'hasnextimage', 'hasNextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'haspreviousimage', 'hasPreviousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'implodeimage', 'implodeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'labelimage', 'labelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'levelimage', 'levelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'magnifyimage', 'magnifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'mapimage', 'mapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'medianfilterimage', 'medianFilterImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'minifyimage', 'minifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'modulateimage', 'modulateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'motionblurimage', 'motionBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'newimage', 'newImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'nextimage', 'nextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'normalizeimage', 'normalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'oilpaintimage', 'oilPaintImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'previousimage', 'previousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'profileimage', 'profileImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimage', 'quantizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimages', 'quantizeImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfontmetrics', 'queryFontMetrics'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfonts', 'queryFonts'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryformats', 'queryFormats'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'radialblurimage', 'radialBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'raiseimage', 'raiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimage', 'readimages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimageblob', 'readImageBlob'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimagefile', 'readImageFile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'reducenoiseimage', 'reduceNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimage', 'removeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimageprofile', 'removeImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resampleimage', 'resampleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resizeimage', 'resizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rollimage', 'rollImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rotateimage', 'rotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'scaleimage', 'scaleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'separateimagechannel', 'separateImageChannel'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setCompressionQuality', 'getCompressionQuality'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setfilename', 'setFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebackgroundcolor', 'setImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageblueprimary', 'setImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebordercolor', 'setImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagechanneldepth', 'setImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecolorspace', 'setImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecompose', 'setImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedelay', 'setImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedepth', 'setImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedispose', 'setImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagefilename', 'setImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageformat', 'setImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegamma', 'setImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegreenprimary', 'setImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageindex', 'setImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageinterlacescheme', 'setImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageiterations', 'setImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageprofile', 'setImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageredprimary', 'setImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagerenderingintent', 'setImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageresolution', 'setImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagescene', 'setImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagetype', 'setImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageunits', 'setImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagewhitepoint', 'setImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsamplingfactors', 'setSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsize', 'setSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'shearimage', 'shearImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'solarizeimage', 'solarizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'spreadimage', 'spreadImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'stripimage', 'stripImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'swirlimage', 'swirlImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'thumbnailimage', 'thumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'trimimage', 'trimImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'writeimage', 'writeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolor', 'getColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorcount', 'getColorCount'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorvalue', 'getColorValue'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolor', 'setColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolorvalue', 'setColorValue')]); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\Name\RenameClassRector::class, ['Gmagick' => 'Imagick', 'GmagickPixel' => 'ImagickPixel']); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class, [new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addimage', 'addImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'addnoiseimage', 'addNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'annotateimage', 'annotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'blurimage', 'blurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'borderimage', 'borderImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'charcoalimage', 'charcoalImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'chopimage', 'chopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'commentimage', 'commentImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'compositeimage', 'compositeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropimage', 'cropImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cropthumbnailimage', 'cropThumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'cyclecolormapimage', 'cycleColormapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'deconstructimages', 'deconstructImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'despeckleimage', 'despeckleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'drawimage', 'drawImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'edgeimage', 'edgeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'embossimage', 'embossImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'enhanceimage', 'enhanceImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'equalizeimage', 'equalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flipimage', 'flipImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'flopimage', 'flopImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'frameimage', 'frameImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'gammaimage', 'gammaImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getcopyright', 'getCopyright'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getfilename', 'getFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebackgroundcolor', 'getImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageblueprimary', 'getImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagebordercolor', 'getImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagechanneldepth', 'getImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolors', 'getImageColors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecolorspace', 'getImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagecompose', 'getImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedelay', 'getImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedepth', 'getImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagedispose', 'getImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageextrema', 'getImageExtrema'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagefilename', 'getImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageformat', 'getImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegamma', 'getImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagegreenprimary', 'getImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageheight', 'getImageHeight'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagehistogram', 'getImageHistogram'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageindex', 'getImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageinterlacescheme', 'getImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageiterations', 'getImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagematte', 'getImageMatte'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagemattecolor', 'getImageMatteColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageprofile', 'getImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageredprimary', 'getImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagerenderingintent', 'getImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageresolution', 'getImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagescene', 'getImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagesignature', 'getImageSignature'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagetype', 'getImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimageunits', 'getImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewhitepoint', 'getImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getimagewidth', 'getImageWidth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getpackagename', 'getPackageName'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getquantumdepth', 'getQuantumDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getreleasedate', 'getReleaseDate'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsamplingfactors', 'getSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getsize', 'getSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'getversion', 'getVersion'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'hasnextimage', 'hasNextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'haspreviousimage', 'hasPreviousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'implodeimage', 'implodeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'labelimage', 'labelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'levelimage', 'levelImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'magnifyimage', 'magnifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'mapimage', 'mapImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'medianfilterimage', 'medianFilterImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'minifyimage', 'minifyImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'modulateimage', 'modulateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'motionblurimage', 'motionBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'newimage', 'newImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'nextimage', 'nextImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'normalizeimage', 'normalizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'oilpaintimage', 'oilPaintImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'previousimage', 'previousImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'profileimage', 'profileImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimage', 'quantizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'quantizeimages', 'quantizeImages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfontmetrics', 'queryFontMetrics'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryfonts', 'queryFonts'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'queryformats', 'queryFormats'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'radialblurimage', 'radialBlurImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'raiseimage', 'raiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimage', 'readimages'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimageblob', 'readImageBlob'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'readimagefile', 'readImageFile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'reducenoiseimage', 'reduceNoiseImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimage', 'removeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'removeimageprofile', 'removeImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resampleimage', 'resampleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'resizeimage', 'resizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rollimage', 'rollImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'rotateimage', 'rotateImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'scaleimage', 'scaleImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'separateimagechannel', 'separateImageChannel'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setCompressionQuality', 'getCompressionQuality'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setfilename', 'setFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebackgroundcolor', 'setImageBackgroundColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageblueprimary', 'setImageBluePrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagebordercolor', 'setImageBorderColor'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagechanneldepth', 'setImageChannelDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecolorspace', 'setImageColorspace'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagecompose', 'setImageCompose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedelay', 'setImageDelay'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedepth', 'setImageDepth'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagedispose', 'setImageDispose'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagefilename', 'setImageFilename'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageformat', 'setImageFormat'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegamma', 'setImageGamma'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagegreenprimary', 'setImageGreenPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageindex', 'setImageIndex'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageinterlacescheme', 'setImageInterlaceScheme'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageiterations', 'setImageIterations'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageprofile', 'setImageProfile'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageredprimary', 'setImageRedPrimary'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagerenderingintent', 'setImageRenderingIntent'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageresolution', 'setImageResolution'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagescene', 'setImageScene'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagetype', 'setImageType'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimageunits', 'setImageUnits'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setimagewhitepoint', 'setImageWhitePoint'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsamplingfactors', 'setSamplingFactors'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'setsize', 'setSize'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'shearimage', 'shearImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'solarizeimage', 'solarizeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'spreadimage', 'spreadImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'stripimage', 'stripImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'swirlimage', 'swirlImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'thumbnailimage', 'thumbnailImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'trimimage', 'trimImage'), new \Rector\Renaming\ValueObject\MethodCallRename('Gmagick', 'writeimage', 'writeImage'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolor', 'getColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorcount', 'getColorCount'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'getcolorvalue', 'getColorValue'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolor', 'setColor'), new \Rector\Renaming\ValueObject\MethodCallRename('GmagickPixel', 'setcolorvalue', 'setColorValue')]); }; diff --git a/config/set/guzzle50.php b/config/set/guzzle50.php index 11a436466e2..4ff2712c1bc 100644 --- a/config/set/guzzle50.php +++ b/config/set/guzzle50.php @@ -11,9 +11,8 @@ use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; use Rector\Transform\ValueObject\FuncCallToMethodCall; use Rector\Transform\ValueObject\StaticCallToFuncCall; 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')]); - $services->set(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class)->configure([new \Rector\Renaming\ValueObject\MethodCallRename('GuzzleHttp\\Message\\MessageInterface', 'getHeaderLines', 'getHeaderAsArray')]); + $rectorConfig->ruleWithConfiguration(\Rector\Transform\Rector\FuncCall\FuncCallToMethodCallRector::class, $configuration); + $rectorConfig->ruleWithConfiguration(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class, [new \Rector\Transform\ValueObject\StaticCallToFuncCall('GuzzleHttp\\Utils', 'setPath', 'GuzzleHttp\\set_path'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('GuzzleHttp\\Pool', 'batch', 'GuzzleHttp\\Pool\\batch')]); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\MethodCall\RenameMethodRector::class, [new \Rector\Renaming\ValueObject\MethodCallRename('GuzzleHttp\\Message\\MessageInterface', 'getHeaderLines', 'getHeaderAsArray')]); }; diff --git a/config/set/naming.php b/config/set/naming.php index e3a77a74c41..4a0bc94926b 100644 --- a/config/set/naming.php +++ b/config/set/naming.php @@ -11,11 +11,10 @@ use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector; use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector; use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector; 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); - $services->set(\Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector::class); - $services->set(\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class); - $services->set(\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class); + $rectorConfig->rule(\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector::class); }; diff --git a/config/set/php52.php b/config/set/php52.php index 13406ce3b51..18b22a91ba8 100644 --- a/config/set/php52.php +++ b/config/set/php52.php @@ -9,10 +9,9 @@ use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector; use Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector; use Rector\Removing\ValueObject\RemoveFuncCallArg; 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([ + $rectorConfig->rule(\Rector\Php52\Rector\Property\VarToPublicPropertyRector::class); + $rectorConfig->rule(\Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Removing\Rector\FuncCall\RemoveFuncCallArgRector::class, [ // see https://www.php.net/manual/en/function.ldap-first-attribute.php new \Rector\Removing\ValueObject\RemoveFuncCallArg('ldap_first_attribute', 2), ]); diff --git a/config/set/php53.php b/config/set/php53.php index 5dfa346bd60..32a50639d39 100644 --- a/config/set/php53.php +++ b/config/set/php53.php @@ -8,8 +8,7 @@ use Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector; use Rector\Php53\Rector\Ternary\TernaryToElvisRector; use Rector\Php53\Rector\Variable\ReplaceHttpServerVarsByServerRector; 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); + $rectorConfig->rule(\Rector\Php53\Rector\Ternary\TernaryToElvisRector::class); + $rectorConfig->rule(\Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector::class); + $rectorConfig->rule(\Rector\Php53\Rector\Variable\ReplaceHttpServerVarsByServerRector::class); }; diff --git a/config/set/php54.php b/config/set/php54.php index e1635677da6..507da36f201 100644 --- a/config/set/php54.php +++ b/config/set/php54.php @@ -8,8 +8,7 @@ use Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector; use Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; 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); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class, ['mysqli_param_count' => 'mysqli_stmt_param_count']); + $rectorConfig->rule(\Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector::class); + $rectorConfig->rule(\Rector\Php54\Rector\Break_\RemoveZeroBreakContinueRector::class); }; diff --git a/config/set/php55.php b/config/set/php55.php index 9161915e263..6902135b2cd 100644 --- a/config/set/php55.php +++ b/config/set/php55.php @@ -10,10 +10,9 @@ use Rector\Php55\Rector\FuncCall\GetCalledClassToStaticClassRector; use Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; 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); - $services->set(\Rector\Php55\Rector\FuncCall\GetCalledClassToSelfClassRector::class); - $services->set(\Rector\Php55\Rector\FuncCall\GetCalledClassToStaticClassRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\FuncCall\GetCalledClassToSelfClassRector::class); + $rectorConfig->rule(\Rector\Php55\Rector\FuncCall\GetCalledClassToStaticClassRector::class); }; diff --git a/config/set/php56.php b/config/set/php56.php index f8e9eb2936c..8da7bba7c6f 100644 --- a/config/set/php56.php +++ b/config/set/php56.php @@ -8,9 +8,8 @@ use Rector\Php56\Rector\FuncCall\PowToExpRector; use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector; use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; 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']); + $rectorConfig->rule(\Rector\Php56\Rector\FuncCall\PowToExpRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class, ['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 - $services->set(\Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector::class); + $rectorConfig->rule(\Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector::class); }; diff --git a/config/set/php70.php b/config/set/php70.php index 7207247790e..c1cf9f4a18e 100644 --- a/config/set/php70.php +++ b/config/set/php70.php @@ -24,25 +24,24 @@ use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector; use Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector; use Rector\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector; 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); - $services->set(\Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector::class); - $services->set(\Rector\Php70\Rector\FuncCall\MultiDirnameRector::class); - $services->set(\Rector\Php70\Rector\Assign\ListSplitStringRector::class); - $services->set(\Rector\Php70\Rector\List_\EmptyListRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\ClassMethod\Php4ConstructorRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\RandomFunctionRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\MultiDirnameRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Assign\ListSplitStringRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\List_\EmptyListRector::class); # be careful, run this just once, since it can keep swapping order back and forth - $services->set(\Rector\Php70\Rector\Assign\ListSwapArrayOrderRector::class); - $services->set(\Rector\Php70\Rector\FuncCall\CallUserMethodRector::class); - $services->set(\Rector\Php70\Rector\FuncCall\EregToPregMatchRector::class); - $services->set(\Rector\Php70\Rector\Switch_\ReduceMultipleDefaultSwitchRector::class); - $services->set(\Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class); - $services->set(\Rector\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector::class); - $services->set(\Rector\Php70\Rector\If_\IfToSpaceshipRector::class); - $services->set(\Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class); - $services->set(\Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class); - $services->set(\Rector\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector::class); - $services->set(\Rector\Php70\Rector\FuncCall\RenameMktimeWithoutArgsToTimeRector::class); - $services->set(\Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Assign\ListSwapArrayOrderRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\CallUserMethodRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\EregToPregMatchRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Switch_\ReduceMultipleDefaultSwitchRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Variable\WrapVariableVariableNameInCurlyBracesRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\If_\IfToSpaceshipRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\RenameMktimeWithoutArgsToTimeRector::class); + $rectorConfig->rule(\Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class); }; diff --git a/config/set/php80.php b/config/set/php80.php index 0db30d7580d..74e4d1010a7 100644 --- a/config/set/php80.php +++ b/config/set/php80.php @@ -29,28 +29,27 @@ use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; use Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector; use Rector\Transform\ValueObject\StaticCallToFuncCall; 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); - $services->set(\Rector\Php80\Rector\Identical\StrEndsWithRector::class); - $services->set(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class)->configure([new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'startsWith', 'str_starts_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'endsWith', 'str_ends_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'contains', 'str_contains')]); - $services->set(\Rector\Php80\Rector\Class_\StringableForToStringRector::class); - $services->set(\Rector\Php80\Rector\FuncCall\ClassOnObjectRector::class); - $services->set(\Rector\Php80\Rector\Ternary\GetDebugTypeRector::class); - $services->set(\Rector\Php80\Rector\FuncCall\TokenGetAllToObjectRector::class); - $services->set(\Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector::class); - $services->set(\Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class); - $services->set(\Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\FunctionLike\UnionTypesRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\NotIdentical\StrContainsRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Identical\StrStartsWithRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Identical\StrEndsWithRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Transform\Rector\StaticCall\StaticCallToFuncCallRector::class, [new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'startsWith', 'str_starts_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'endsWith', 'str_ends_with'), new \Rector\Transform\ValueObject\StaticCallToFuncCall('Nette\\Utils\\Strings', 'contains', 'str_contains')]); + $rectorConfig->rule(\Rector\Php80\Rector\Class_\StringableForToStringRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\FuncCall\ClassOnObjectRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Ternary\GetDebugTypeRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\FuncCall\TokenGetAllToObjectRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Catch_\RemoveUnusedVariableInCatchRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector::class); // nette\utils and Strings::replace() - $services->set(\Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector::class)->configure([new \Rector\Arguments\ValueObject\ArgumentAdder('Nette\\Utils\\Strings', 'replace', 2, 'replacement', '')]); - $services->set(\Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class); - $services->set(\Rector\Php80\Rector\ClassMethod\SetStateToStaticRector::class); - $services->set(\Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector::class, [new \Rector\Arguments\ValueObject\ArgumentAdder('Nette\\Utils\\Strings', 'replace', 2, 'replacement', '')]); + $rectorConfig->rule(\Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\ClassMethod\SetStateToStaticRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector::class); // @see https://php.watch/versions/8.0/pgsql-aliases-deprecated - $services->set(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class)->configure(['pg_clientencoding' => 'pg_client_encoding', 'pg_cmdtuples' => 'pg_affected_rows', 'pg_errormessage' => 'pg_last_error', 'pg_fieldisnull' => 'pg_field_is_null', 'pg_fieldname' => 'pg_field_name', 'pg_fieldnum' => 'pg_field_num', 'pg_fieldprtlen' => 'pg_field_prtlen', 'pg_fieldsize' => 'pg_field_size', 'pg_fieldtype' => 'pg_field_type', 'pg_freeresult' => 'pg_free_result', 'pg_getlastoid' => 'pg_last_oid', 'pg_loclose' => 'pg_lo_close', 'pg_locreate' => 'pg_lo_create', 'pg_loexport' => 'pg_lo_export', 'pg_loimport' => 'pg_lo_import', 'pg_loopen' => 'pg_lo_open', 'pg_loread' => 'pg_lo_read', 'pg_loreadall' => 'pg_lo_read_all', 'pg_lounlink' => 'pg_lo_unlink', 'pg_lowrite' => 'pg_lo_write', 'pg_numfields' => 'pg_num_fields', 'pg_numrows' => 'pg_num_rows', 'pg_result' => 'pg_fetch_result', 'pg_setclientencoding' => 'pg_set_client_encoding']); - $services->set(\Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector::class); - $services->set(\Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector::class)->configure([new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'lte', 'le'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, '', '!='), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, '!', '!='), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'g', 'gt'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'l', 'lt'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'lte', 'le'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'n', 'ne')]); - $services->set(\Rector\Php80\Rector\FuncCall\Php8ResourceReturnToObjectRector::class); - $services->set(\Rector\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Renaming\Rector\FuncCall\RenameFunctionRector::class, ['pg_clientencoding' => 'pg_client_encoding', 'pg_cmdtuples' => 'pg_affected_rows', 'pg_errormessage' => 'pg_last_error', 'pg_fieldisnull' => 'pg_field_is_null', 'pg_fieldname' => 'pg_field_name', 'pg_fieldnum' => 'pg_field_num', 'pg_fieldprtlen' => 'pg_field_prtlen', 'pg_fieldsize' => 'pg_field_size', 'pg_fieldtype' => 'pg_field_type', 'pg_freeresult' => 'pg_free_result', 'pg_getlastoid' => 'pg_last_oid', 'pg_loclose' => 'pg_lo_close', 'pg_locreate' => 'pg_lo_create', 'pg_loexport' => 'pg_lo_export', 'pg_loimport' => 'pg_lo_import', 'pg_loopen' => 'pg_lo_open', 'pg_loread' => 'pg_lo_read', 'pg_loreadall' => 'pg_lo_read_all', 'pg_lounlink' => 'pg_lo_unlink', 'pg_lowrite' => 'pg_lo_write', 'pg_numfields' => 'pg_num_fields', 'pg_numrows' => 'pg_num_rows', 'pg_result' => 'pg_fetch_result', 'pg_setclientencoding' => 'pg_set_client_encoding']); + $rectorConfig->rule(\Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector::class); + $rectorConfig->ruleWithConfiguration(\Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector::class, [new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'lte', 'le'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, '', '!='), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, '!', '!='), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'g', 'gt'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'l', 'lt'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'gte', 'ge'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'lte', 'le'), new \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue('version_compare', 2, 'n', 'ne')]); + $rectorConfig->rule(\Rector\Php80\Rector\FuncCall\Php8ResourceReturnToObjectRector::class); + $rectorConfig->rule(\Rector\Php80\Rector\ClassMethod\AddParamBasedOnParentClassMethodRector::class); }; diff --git a/config/set/php81.php b/config/set/php81.php index f492cb52555..981bf3a5916 100644 --- a/config/set/php81.php +++ b/config/set/php81.php @@ -15,15 +15,14 @@ use Rector\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector; use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; 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); - $services->set(\Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector::class); - $services->set(\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class); - $services->set(\Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector::class); - $services->set(\Rector\Php81\Rector\FuncCall\Php81ResourceReturnToObjectRector::class); - $services->set(\Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class); - $services->set(\Rector\Php81\Rector\FunctionLike\IntersectionTypesRector::class); - $services->set(\Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\MethodCall\MyCLabsMethodCallToEnumConstRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\ClassConst\FinalizePublicClassConstantRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\Property\ReadOnlyPropertyRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\FuncCall\Php81ResourceReturnToObjectRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\FunctionLike\IntersectionTypesRector::class); + $rectorConfig->rule(\Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector::class); }; diff --git a/config/set/privatization.php b/config/set/privatization.php index 65cce1a9dd5..f7a8eb33580 100644 --- a/config/set/privatization.php +++ b/config/set/privatization.php @@ -14,15 +14,14 @@ use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector; use Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector; use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; 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); - $services->set(\Rector\Privatization\Rector\Class_\ChangeReadOnlyVariableWithDefaultValueToConstantRector::class); - $services->set(\Rector\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector::class); - $services->set(\Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector::class); - $services->set(\Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector::class); - $services->set(\Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Class_\ChangeGlobalVariablesToPropertiesRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Property\ChangeReadOnlyPropertyWithDefaultValueToConstantRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Class_\ChangeReadOnlyVariableWithDefaultValueToConstantRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Class_\RepeatedLiteralToClassConstantRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector::class); + $rectorConfig->rule(\Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector::class); // buggy, requires more work // $services->set(ChangeLocalPropertyToVariableRector::class); }; diff --git a/config/set/psr-4.php b/config/set/psr-4.php index 12907e0dc0f..4e3e0600585 100644 --- a/config/set/psr-4.php +++ b/config/set/psr-4.php @@ -7,7 +7,6 @@ use Rector\Config\RectorConfig; use Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector; use Rector\PSR4\Rector\Namespace_\MultipleClassFileToPsr4ClassesRector; 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); + $rectorConfig->rule(\Rector\PSR4\Rector\FileWithoutNamespace\NormalizeNamespaceByPSR4ComposerAutoloadRector::class); + $rectorConfig->rule(\Rector\PSR4\Rector\Namespace_\MultipleClassFileToPsr4ClassesRector::class); }; diff --git a/config/set/rector-config.php b/config/set/rector-config.php new file mode 100644 index 00000000000..0af061f36f2 --- /dev/null +++ b/config/set/rector-config.php @@ -0,0 +1,10 @@ +rule(\Rector\DogFood\Rector\Closure\UpgradeRectorConfigRector::class); +}; diff --git a/config/set/type-declaration-strict.php b/config/set/type-declaration-strict.php index 0829b0c78f4..0146e30833f 100644 --- a/config/set/type-declaration-strict.php +++ b/config/set/type-declaration-strict.php @@ -15,15 +15,14 @@ use Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector; 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); - $services->set(\Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector::class); - $services->set(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Param\ParamTypeFromStrictTypedPropertyRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ArrayShapeFromConstantArrayReturnRector::class); }; diff --git a/config/set/type-declaration.php b/config/set/type-declaration.php index 742bf34ffdd..669461453fe 100644 --- a/config/set/type-declaration.php +++ b/config/set/type-declaration.php @@ -17,17 +17,16 @@ use Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\TypeDeclaration\Rector\Property\VarAnnotationIncorrectNullableRector; 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); - $services->set(\Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector::class); - $services->set(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnAnnotationIncorrectNullableRector::class); - $services->set(\Rector\TypeDeclaration\Rector\Property\VarAnnotationIncorrectNullableRector::class); - $services->set(\Rector\TypeDeclaration\Rector\ClassMethod\ParamAnnotationIncorrectNullableRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\FunctionLike\ReturnTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Property\PropertyTypeDeclarationRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\AddArrayParamDocTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByParentCallTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ReturnAnnotationIncorrectNullableRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\Property\VarAnnotationIncorrectNullableRector::class); + $rectorConfig->rule(\Rector\TypeDeclaration\Rector\ClassMethod\ParamAnnotationIncorrectNullableRector::class); }; diff --git a/config/set/unwrap-compat.php b/config/set/unwrap-compat.php index 68c72b46cf9..5d2a5e28c96 100644 --- a/config/set/unwrap-compat.php +++ b/config/set/unwrap-compat.php @@ -6,6 +6,5 @@ namespace RectorPrefix20220420; use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector; return static function (\Rector\Config\RectorConfig $rectorConfig) : void { - $services = $rectorConfig->services(); - $services->set(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector::class); + $rectorConfig->rule(\Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector::class); }; diff --git a/packages/Set/ValueObject/SetList.php b/packages/Set/ValueObject/SetList.php index 2251a035620..defbdd8006a 100644 --- a/packages/Set/ValueObject/SetList.php +++ b/packages/Set/ValueObject/SetList.php @@ -126,4 +126,8 @@ final class SetList implements \Rector\Set\Contract\SetListInterface * @var string */ public const EARLY_RETURN = __DIR__ . '/../../../config/set/early-return.php'; + /** + * @var string + */ + public const RECTOR_CONFIG = __DIR__ . '/../../../config/set/rector-config.php'; } diff --git a/rules/DogFood/Rector/Closure/UpgradeRectorConfigRector.php b/rules/DogFood/Rector/Closure/UpgradeRectorConfigRector.php index 757f62c8285..85dd8790f8c 100644 --- a/rules/DogFood/Rector/Closure/UpgradeRectorConfigRector.php +++ b/rules/DogFood/Rector/Closure/UpgradeRectorConfigRector.php @@ -37,7 +37,11 @@ final class UpgradeRectorConfigRector extends \Rector\Core\Rector\AbstractRector /** * @var string */ - private const PARAMETERS = 'parameters'; + private const PARAMETERS_VARIABLE = 'parameters'; + /** + * @var string + */ + private const CONTAINER_CONFIGURATOR_VARIABLE = 'containerConfigurator'; /** * @readonly * @var \Rector\DogFood\NodeAnalyzer\ContainerConfiguratorCallAnalyzer @@ -119,7 +123,7 @@ CODE_SAMPLE $node->name = new \PhpParser\Node\Identifier('rule'); return $node; } - if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node, self::PARAMETERS, 'set')) { + if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node, self::PARAMETERS_VARIABLE, 'set')) { return $this->refactorParameterName($node); } } @@ -130,21 +134,26 @@ CODE_SAMPLE // change the node return $node; } + /** + * Remove helper methods calls like: + * $services = $containerConfigurator->services(); + * $parameters = $containerConfigurator->parameters(); + */ public function removeHelperAssigns(\PhpParser\Node $node) : void { if (!$node instanceof \PhpParser\Node\Expr\Assign) { return; } - if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, 'containerConfigurator', 'services')) { + if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, self::CONTAINER_CONFIGURATOR_VARIABLE, 'services')) { $this->removeNode($node); } if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, self::RECTOR_CONFIG_VARIABLE, 'services')) { $this->removeNode($node); } - if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, 'containerConfigurator', self::PARAMETERS)) { + if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, self::CONTAINER_CONFIGURATOR_VARIABLE, self::PARAMETERS_VARIABLE)) { $this->removeNode($node); } - if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, self::RECTOR_CONFIG_VARIABLE, self::PARAMETERS)) { + if ($this->containerConfiguratorCallAnalyzer->isMethodCallNamed($node->expr, self::RECTOR_CONFIG_VARIABLE, self::PARAMETERS_VARIABLE)) { $this->removeNode($node); } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 9fb38f56324..35a691da7b4 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = 'd90953d9a9ddd9a7517c78e28a5f5e417d1f99d3'; + public const PACKAGE_VERSION = '03fbf02ec4fb7a059659501a0f2fee760555639b'; /** * @var string */ - public const RELEASE_DATE = '2022-04-20 07:00:08'; + public const RELEASE_DATE = '2022-04-20 07:05:49'; /** * @var string */ diff --git a/vendor/autoload.php b/vendor/autoload.php index bd96fbf6071..e9a90a36d6c 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea::getLoader(); +return ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 1e230f7e2f6..6f8a5044e2f 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea +class ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire14d8c25aa49cc2c768422f3d495955ea($fileIdentifier, $file); + composerRequire78bd4bd3c563158e885917baa7c6d2dd($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea * @param string $file * @return void */ -function composerRequire14d8c25aa49cc2c768422f3d495955ea($fileIdentifier, $file) +function composerRequire78bd4bd3c563158e885917baa7c6d2dd($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index b82781fd05e..c2ab7797bd3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea +class ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd { public static $files = array ( '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', @@ -3867,9 +3867,9 @@ class ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit14d8c25aa49cc2c768422f3d495955ea::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit78bd4bd3c563158e885917baa7c6d2dd::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 4895aa8528c..e25de168775 100644 --- a/vendor/scoper-autoload.php +++ b/vendor/scoper-autoload.php @@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php'; if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) { spl_autoload_call('RectorPrefix20220420\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea', false) && !interface_exists('ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea', false) && !trait_exists('ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea', false)) { - spl_autoload_call('RectorPrefix20220420\ComposerAutoloaderInit14d8c25aa49cc2c768422f3d495955ea'); +if (!class_exists('ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd', false) && !interface_exists('ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd', false) && !trait_exists('ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd', false)) { + spl_autoload_call('RectorPrefix20220420\ComposerAutoloaderInit78bd4bd3c563158e885917baa7c6d2dd'); } 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('RectorPrefix20220420\Helmich\TypoScriptParser\Parser\AST\Statement'); @@ -59,9 +59,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20220420\print_node(...func_get_args()); } } -if (!function_exists('composerRequire14d8c25aa49cc2c768422f3d495955ea')) { - function composerRequire14d8c25aa49cc2c768422f3d495955ea() { - return \RectorPrefix20220420\composerRequire14d8c25aa49cc2c768422f3d495955ea(...func_get_args()); +if (!function_exists('composerRequire78bd4bd3c563158e885917baa7c6d2dd')) { + function composerRequire78bd4bd3c563158e885917baa7c6d2dd() { + return \RectorPrefix20220420\composerRequire78bd4bd3c563158e885917baa7c6d2dd(...func_get_args()); } } if (!function_exists('scanPath')) {