diff --git a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php index 4fed7a5a791..1db1017d75c 100644 --- a/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php +++ b/rules/Arguments/Rector/ClassMethod/ArgumentAdderRector.php @@ -31,11 +31,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ArgumentAdderRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ADDED_ARGUMENTS = 'added_arguments'; /** * @var ArgumentAdder[] */ @@ -118,9 +113,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $addedArguments = $configuration[self::ADDED_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($addedArguments, \Rector\Arguments\ValueObject\ArgumentAdder::class); - $this->addedArguments = $addedArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Arguments\ValueObject\ArgumentAdder::class); + $this->addedArguments = $configuration; } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Stmt\ClassMethod $node diff --git a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php index 41ca0b356d7..1b66287d298 100644 --- a/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php +++ b/rules/Arguments/Rector/ClassMethod/ReplaceArgumentDefaultValueRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ReplaceArgumentDefaultValueRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const REPLACED_ARGUMENTS = 'replaced_arguments'; /** * @var ReplaceArgumentDefaultValue[] */ @@ -85,9 +80,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $replacedArguments = $configuration[self::REPLACED_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($replacedArguments); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($replacedArguments, \Rector\Arguments\ValueObject\ReplaceArgumentDefaultValue::class); - $this->replacedArguments = $replacedArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Arguments\ValueObject\ReplaceArgumentDefaultValue::class); + $this->replacedArguments = $configuration; } } diff --git a/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php b/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php index 6b6af665d9b..70ba9a32df6 100644 --- a/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php +++ b/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class FunctionArgumentDefaultValueReplacerRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const REPLACED_ARGUMENTS = 'replaced_arguments'; /** * @var ReplaceFuncCallArgumentDefaultValue[] */ @@ -81,8 +76,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $replacedArguments = $configuration[self::REPLACED_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($replacedArguments, \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue::class); - $this->replacedArguments = $replacedArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Arguments\ValueObject\ReplaceFuncCallArgumentDefaultValue::class); + $this->replacedArguments = $configuration; } } diff --git a/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php b/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php index 7b5b6893674..f367c3ef0d3 100644 --- a/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php +++ b/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class SwapFuncCallArgumentsRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNCTION_ARGUMENT_SWAPS = 'new_argument_positions_by_function_name'; /** * @var string */ @@ -89,9 +84,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $functionArgumentSwaps = $configuration[self::FUNCTION_ARGUMENT_SWAPS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($functionArgumentSwaps, \Rector\Arguments\ValueObject\SwapFuncCallArguments::class); - $this->functionArgumentSwaps = $functionArgumentSwaps; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Arguments\ValueObject\SwapFuncCallArguments::class); + $this->functionArgumentSwaps = $configuration; } /** * @return array diff --git a/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php b/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php index 6e87db18613..9c80fbcbcb4 100644 --- a/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php +++ b/rules/Autodiscovery/Rector/Class_/MoveServicesBySuffixToDirectoryRector.php @@ -23,11 +23,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MoveServicesBySuffixToDirectoryRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const GROUP_NAMES_BY_SUFFIX = 'group_names_by_suffix'; /** * @var string[] */ @@ -89,10 +84,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $groupNamesBySuffix = $configuration[self::GROUP_NAMES_BY_SUFFIX] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($groupNamesBySuffix); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($groupNamesBySuffix); - $this->groupNamesBySuffix = $groupNamesBySuffix; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->groupNamesBySuffix = $configuration; } /** * A. Match classes by suffix and move them to group namespace diff --git a/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php b/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php index f3251ac2c8a..bafc4f65fdc 100644 --- a/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php +++ b/rules/CodingStyle/Rector/ClassMethod/OrderAttributesRector.php @@ -22,11 +22,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class OrderAttributesRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ATTRIBUTES_ORDER = 'attributes_order'; /** * @var array */ @@ -82,10 +77,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $attributesOrder = $configuration[self::ATTRIBUTES_ORDER] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($attributesOrder); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($attributesOrder); - $this->attributesOrderByName = \array_flip($attributesOrder); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->attributesOrderByName = \array_flip($configuration); } private function resolveAttributeGroupPosition(\PhpParser\Node\AttributeGroup $attributeGroup) : int { diff --git a/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php b/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php index 35388e35642..ee445a49e5d 100644 --- a/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php +++ b/rules/CodingStyle/Rector/ClassMethod/ReturnArrayClassMethodToYieldRector.php @@ -27,11 +27,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ReturnArrayClassMethodToYieldRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHODS_TO_YIELDS = 'methods_to_yields'; /** * @var ReturnArrayClassMethodToyield[] */ @@ -115,9 +110,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodsToYields = $configuration[self::METHODS_TO_YIELDS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodsToYields, \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield::class); - $this->methodsToYields = $methodsToYields; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield::class); + $this->methodsToYields = $configuration; } private function collectReturnArrayNodesFromClassMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod) : ?\PhpParser\Node\Expr\Array_ { diff --git a/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php b/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php index 4c0fcc5df2d..b8455107162 100644 --- a/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php +++ b/rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php @@ -21,12 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class PreferThisOrSelfMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const TYPE_TO_PREFERENCE = 'type_to_preference'; /** * @var string */ @@ -99,11 +93,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $typeToPreference = $configuration[self::TYPE_TO_PREFERENCE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($typeToPreference); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($typeToPreference)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($typeToPreference, \Rector\CodingStyle\Enum\PreferenceSelfThis::class); - $this->typeToPreference = $typeToPreference; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\CodingStyle\Enum\PreferenceSelfThis::class); + $this->typeToPreference = $configuration; } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall $node diff --git a/rules/Composer/Rector/AddPackageToRequireComposerRector.php b/rules/Composer/Rector/AddPackageToRequireComposerRector.php index 5a544120ca6..f3aa7996975 100644 --- a/rules/Composer/Rector/AddPackageToRequireComposerRector.php +++ b/rules/Composer/Rector/AddPackageToRequireComposerRector.php @@ -15,11 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddPackageToRequireComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; /** * @var PackageAndVersion[] */ @@ -59,9 +54,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class); - $this->versionGuard->validate($packagesAndVersions); - $this->packagesAndVersions = $packagesAndVersions; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Composer\ValueObject\PackageAndVersion::class); + $this->versionGuard->validate($configuration); + $this->packagesAndVersions = $configuration; } } diff --git a/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php b/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php index 5356372e6b3..c69e7b3b486 100644 --- a/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php +++ b/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php @@ -15,11 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddPackageToRequireDevComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const PACKAGES_AND_VERSIONS = 'packages_and_version'; /** * @var PackageAndVersion[] */ @@ -59,9 +54,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class); - $this->versionGuard->validate($packagesAndVersions); - $this->packageAndVersions = $packagesAndVersions; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Composer\ValueObject\PackageAndVersion::class); + $this->versionGuard->validate($configuration); + $this->packageAndVersions = $configuration; } } diff --git a/rules/Composer/Rector/ChangePackageVersionComposerRector.php b/rules/Composer/Rector/ChangePackageVersionComposerRector.php index 083d78d217e..14dae9ceb33 100644 --- a/rules/Composer/Rector/ChangePackageVersionComposerRector.php +++ b/rules/Composer/Rector/ChangePackageVersionComposerRector.php @@ -15,11 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ChangePackageVersionComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const PACKAGES_AND_VERSIONS = 'packages_and_versions'; /** * @var PackageAndVersion[] */ @@ -62,9 +57,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $packagesAndVersions = $configuration[self::PACKAGES_AND_VERSIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($packagesAndVersions, \Rector\Composer\ValueObject\PackageAndVersion::class); - $this->versionGuard->validate($packagesAndVersions); - $this->packagesAndVersions = $packagesAndVersions; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Composer\ValueObject\PackageAndVersion::class); + $this->versionGuard->validate($configuration); + $this->packagesAndVersions = $configuration; } } diff --git a/rules/Composer/Rector/RemovePackageComposerRector.php b/rules/Composer/Rector/RemovePackageComposerRector.php index 329c9ae9093..447002bd862 100644 --- a/rules/Composer/Rector/RemovePackageComposerRector.php +++ b/rules/Composer/Rector/RemovePackageComposerRector.php @@ -13,11 +13,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemovePackageComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const PACKAGE_NAMES = 'package_names'; /** * @var string[] */ @@ -48,9 +43,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $packagesNames = $configuration[self::PACKAGE_NAMES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($packagesNames); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($packagesNames); - $this->packageNames = $packagesNames; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->packageNames = $configuration; } } diff --git a/rules/Composer/Rector/RenamePackageComposerRector.php b/rules/Composer/Rector/RenamePackageComposerRector.php index dc42288ed23..1c08d24f940 100644 --- a/rules/Composer/Rector/RenamePackageComposerRector.php +++ b/rules/Composer/Rector/RenamePackageComposerRector.php @@ -14,11 +14,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenamePackageComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const RENAME_PACKAGES = 'rename_packages'; /** * @var RenamePackage[] */ @@ -59,8 +54,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $renamePackages = $configuration[self::RENAME_PACKAGES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($renamePackages, \Rector\Composer\ValueObject\RenamePackage::class); - $this->renamePackages = $renamePackages; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Composer\ValueObject\RenamePackage::class); + $this->renamePackages = $configuration; } } diff --git a/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php b/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php index 6fe55d1bc3d..e0cebb31950 100644 --- a/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php +++ b/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php @@ -15,11 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ReplacePackageAndVersionComposerRector implements \Rector\Composer\Contract\Rector\ComposerRectorInterface { - /** - * @deprecated - * @var string - */ - public const REPLACE_PACKAGES_AND_VERSIONS = 'replace_packages_and_versions'; /** * @var ReplacePackageAndVersion[] */ @@ -62,9 +57,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $replacePackagesAndVersions = $configuration[self::REPLACE_PACKAGES_AND_VERSIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($replacePackagesAndVersions, \Rector\Composer\ValueObject\ReplacePackageAndVersion::class); - $this->versionGuard->validate($replacePackagesAndVersions); - $this->replacePackagesAndVersions = $replacePackagesAndVersions; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Composer\ValueObject\ReplacePackageAndVersion::class); + $this->versionGuard->validate($configuration); + $this->replacePackagesAndVersions = $configuration; } } diff --git a/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php b/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php index 0aba3a6a4d1..592367e919c 100644 --- a/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php +++ b/rules/DeadCode/Rector/ClassLike/RemoveAnnotationRector.php @@ -21,11 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveAnnotationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ANNOTATIONS_TO_REMOVE = 'annotations_to_remove'; /** * @var string[] */ @@ -90,9 +85,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $annotationsToRemove = $configuration[self::ANNOTATIONS_TO_REMOVE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($annotationsToRemove); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($annotationsToRemove); - $this->annotationsToRemove = $annotationsToRemove; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->annotationsToRemove = $configuration; } } diff --git a/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php b/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php index 902c30f8d9b..a18ae1e965c 100644 --- a/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php +++ b/rules/DeadCode/Rector/ConstFetch/RemovePhpVersionIdCheckRector.php @@ -23,11 +23,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; */ final class RemovePhpVersionIdCheckRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PHP_VERSION_CONSTRAINT = 'phpVersionConstraint'; /** * @var int|string|null */ @@ -46,11 +41,10 @@ final class RemovePhpVersionIdCheckRector extends \Rector\Core\Rector\AbstractRe */ public function configure(array $configuration) : void { - $this->phpVersionConstraint = $configuration[self::PHP_VERSION_CONSTRAINT] ?? null; + $this->phpVersionConstraint = \array_pop($configuration); } public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition { - $exampleConfiguration = [self::PHP_VERSION_CONSTRAINT => \Rector\Core\ValueObject\PhpVersion::PHP_80]; return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Remove unneeded PHP_VERSION_ID check', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample(<<<'CODE_SAMPLE' class SomeClass { @@ -72,7 +66,7 @@ class SomeClass } } CODE_SAMPLE -, $exampleConfiguration)]); +, [\Rector\Core\ValueObject\PhpVersion::PHP_80])]); } /** * @return array> diff --git a/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php b/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php index 41416477d74..58508a5809a 100644 --- a/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php +++ b/rules/DependencyInjection/Rector/ClassMethod/AddMethodParentCallRector.php @@ -21,11 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddMethodParentCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHODS_BY_PARENT_TYPES = 'methods_by_parent_type'; /** * @var array */ @@ -92,11 +87,10 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodsByParentTypes = $configuration[self::METHODS_BY_PARENT_TYPES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($methodsByParentTypes)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($methodsByParentTypes); - /** @var array $methodsByParentTypes */ - $this->methodByParentTypes = $methodsByParentTypes; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var array $configuration */ + $this->methodByParentTypes = $configuration; } private function shouldSkipMethod(\PhpParser\Node\Stmt\ClassMethod $classMethod, string $method) : bool { diff --git a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php index cb19e0b3f5b..7b48b229c3d 100644 --- a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php +++ b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php @@ -27,11 +27,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class DowngradeAttributeToAnnotationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ATTRIBUTE_TO_ANNOTATION = 'attribute_to_annotation'; /** * @var DowngradeAttributeToAnnotation[] */ @@ -110,9 +105,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $attributesToAnnotations = $configuration[self::ATTRIBUTE_TO_ANNOTATION] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($attributesToAnnotations, \Rector\DowngradePhp80\ValueObject\DowngradeAttributeToAnnotation::class); - $this->attributesToAnnotations = $attributesToAnnotations; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\DowngradePhp80\ValueObject\DowngradeAttributeToAnnotation::class); + $this->attributesToAnnotations = $configuration; } /** * @param \PhpParser\Node\Param|\PhpParser\Node\Stmt\Class_|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Stmt\Interface_|\PhpParser\Node\Stmt\Property $node diff --git a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php index 3f7c2dfa951..bf5a774446c 100644 --- a/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php +++ b/rules/Php55/Rector/String_/StringClassNameToClassConstantRector.php @@ -26,12 +26,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class StringClassNameToClassConstantRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\AllowEmptyConfigurableRectorInterface, \Rector\VersionBonding\Contract\MinPhpVersionInterface { - /** - * @api - * @deprecated - * @var string - */ - public const CLASSES_TO_SKIP = 'classes_to_skip'; /** * @var string[] */ @@ -108,10 +102,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $classesToSkip = $configuration[self::CLASSES_TO_SKIP] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($classesToSkip); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($classesToSkip); - $this->classesToSkip = $classesToSkip; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->classesToSkip = $configuration; } public function provideMinPhpVersion() : int { diff --git a/rules/Php71/Rector/Name/ReservedObjectRector.php b/rules/Php71/Rector/Name/ReservedObjectRector.php index cc30b95ad46..f3e91a3d35d 100644 --- a/rules/Php71/Rector/Name/ReservedObjectRector.php +++ b/rules/Php71/Rector/Name/ReservedObjectRector.php @@ -22,11 +22,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ReservedObjectRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface, \Rector\VersionBonding\Contract\MinPhpVersionInterface { - /** - * @deprecated - * @var string - */ - public const RESERVED_KEYWORDS_TO_REPLACEMENTS = 'reserved_keywords_to_replacements'; /** * @var array */ @@ -71,11 +66,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $reservedKeywordsToReplacements = $configuration[self::RESERVED_KEYWORDS_TO_REPLACEMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($reservedKeywordsToReplacements); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($reservedKeywordsToReplacements)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($reservedKeywordsToReplacements); - $this->reservedKeywordsToReplacements = $reservedKeywordsToReplacements; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->reservedKeywordsToReplacements = $configuration; } private function processIdentifier(\PhpParser\Node\Identifier $identifier) : \PhpParser\Node\Identifier { diff --git a/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php b/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php index 2b7350b5ffe..e54b0567652 100644 --- a/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php +++ b/rules/Php80/Rector/Class_/AnnotationToAttributeRector.php @@ -40,11 +40,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AnnotationToAttributeRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface, \Rector\VersionBonding\Contract\MinPhpVersionInterface { - /** - * @deprecated - * @var string - */ - public const ANNOTATION_TO_ATTRIBUTE = 'annotations_to_attributes'; /** * @var AnnotationToAttribute[] */ @@ -148,11 +143,10 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $annotationsToAttributes = $configuration[self::ANNOTATION_TO_ATTRIBUTE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($annotationsToAttributes, \Rector\Php80\ValueObject\AnnotationToAttribute::class); - $this->annotationsToAttributes = $annotationsToAttributes; - $this->unwrapableAnnotationAnalyzer->configure($annotationsToAttributes); - $this->removableAnnotationAnalyzer->configure($annotationsToAttributes); + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Php80\ValueObject\AnnotationToAttribute::class); + $this->annotationsToAttributes = $configuration; + $this->unwrapableAnnotationAnalyzer->configure($configuration); + $this->removableAnnotationAnalyzer->configure($configuration); } public function provideMinPhpVersion() : int { diff --git a/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php b/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php index cd20cef6815..d4febfc1b78 100644 --- a/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php +++ b/rules/Privatization/Rector/MethodCall/ReplaceStringWithClassConstantRector.php @@ -13,16 +13,12 @@ use Rector\Privatization\NodeFactory\ClassConstantFetchValueFactory; use Rector\Privatization\ValueObject\ReplaceStringWithClassConstant; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; +use RectorPrefix20220218\Webmozart\Assert\Assert; /** * @see \Rector\Tests\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector\ReplaceStringWithClassConstantRectorTest */ final class ReplaceStringWithClassConstantRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const REPLACE_STRING_WITH_CLASS_CONSTANT = 'replace_string_with_class_constant'; /** * @var ReplaceStringWithClassConstant[] */ @@ -96,7 +92,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $this->replaceStringWithClassConstants = $configuration[self::REPLACE_STRING_WITH_CLASS_CONSTANT] ?? $configuration; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Privatization\ValueObject\ReplaceStringWithClassConstant::class); + $this->replaceStringWithClassConstants = $configuration; } private function matchArg(\PhpParser\Node\Expr\MethodCall $methodCall, \Rector\Privatization\ValueObject\ReplaceStringWithClassConstant $replaceStringWithClassConstant) : ?\PhpParser\Node\Arg { diff --git a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php index 965d94a73d4..e7df051a7bc 100644 --- a/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php +++ b/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ArgumentRemoverRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const REMOVED_ARGUMENTS = 'removed_arguments'; /** * @var ArgumentRemover[] */ @@ -70,9 +65,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $removedArguments = $configuration[self::REMOVED_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($removedArguments, \Rector\Removing\ValueObject\ArgumentRemover::class); - $this->removedArguments = $removedArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Removing\ValueObject\ArgumentRemover::class); + $this->removedArguments = $configuration; } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Stmt\ClassMethod $node diff --git a/rules/Removing/Rector/Class_/RemoveInterfacesRector.php b/rules/Removing/Rector/Class_/RemoveInterfacesRector.php index 17bc5b0c4aa..9753d8bb251 100644 --- a/rules/Removing/Rector/Class_/RemoveInterfacesRector.php +++ b/rules/Removing/Rector/Class_/RemoveInterfacesRector.php @@ -15,11 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveInterfacesRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const INTERFACES_TO_REMOVE = 'interfaces_to_remove'; /** * @var string[] */ @@ -65,9 +60,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $interfacesToRemove = $configuration[self::INTERFACES_TO_REMOVE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($interfacesToRemove); - /** @var string[] $interfacesToRemove */ - $this->interfacesToRemove = $interfacesToRemove; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var string[] $configuration */ + $this->interfacesToRemove = $configuration; } } diff --git a/rules/Removing/Rector/Class_/RemoveParentRector.php b/rules/Removing/Rector/Class_/RemoveParentRector.php index 47abe5c0291..df36ffef228 100644 --- a/rules/Removing/Rector/Class_/RemoveParentRector.php +++ b/rules/Removing/Rector/Class_/RemoveParentRector.php @@ -18,12 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveParentRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const PARENT_TYPES_TO_REMOVE = 'parents_types_to_remove'; /** * @var string[] */ @@ -83,9 +77,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $parentTypesToRemove = $configuration[self::PARENT_TYPES_TO_REMOVE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($parentTypesToRemove); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($parentTypesToRemove); - $this->parentClassesToRemove = $parentTypesToRemove; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->parentClassesToRemove = $configuration; } } diff --git a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php index a94386cc13e..9044a095e8b 100644 --- a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php +++ b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveTraitUseRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const TRAITS_TO_REMOVE = 'traits_to_remove'; /** * @var bool */ @@ -79,9 +74,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $traitsToRemove = $configuration[self::TRAITS_TO_REMOVE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($traitsToRemove); - /** @var string[] $traitsToRemove */ - $this->traitsToRemove = $traitsToRemove; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->traitsToRemove = $configuration; } } diff --git a/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php b/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php index 485b65567fd..0011a0399b7 100644 --- a/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php +++ b/rules/Removing/Rector/FuncCall/RemoveFuncCallArgRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveFuncCallArgRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const REMOVED_FUNCTION_ARGUMENTS = 'removed_function_arguments'; /** * @var RemoveFuncCallArg[] */ @@ -69,8 +64,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $removedFunctionArguments = $configuration[self::REMOVED_FUNCTION_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($removedFunctionArguments, \Rector\Removing\ValueObject\RemoveFuncCallArg::class); - $this->removedFunctionArguments = $removedFunctionArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Removing\ValueObject\RemoveFuncCallArg::class); + $this->removedFunctionArguments = $configuration; } } diff --git a/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php b/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php index 5af88304c49..60b4d2d0ef7 100644 --- a/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php +++ b/rules/Removing/Rector/FuncCall/RemoveFuncCallRector.php @@ -18,12 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RemoveFuncCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const REMOVE_FUNC_CALLS = 'remove_func_calls'; /** * @var RemoveFuncCall[] */ @@ -77,9 +71,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $removeFuncCalls = $configuration[self::REMOVE_FUNC_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($removeFuncCalls, \Rector\Removing\ValueObject\RemoveFuncCall::class); - $this->removeFuncCalls = $removeFuncCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Removing\ValueObject\RemoveFuncCall::class); + $this->removeFuncCalls = $configuration; } private function refactorFuncCallsWithPositions(\PhpParser\Node\Expr\FuncCall $funcCall, \Rector\Removing\ValueObject\RemoveFuncCall $removeFuncCall) : void { diff --git a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php index 5877b4004f0..a1ce6f8ec6e 100644 --- a/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php +++ b/rules/Renaming/Rector/ClassConstFetch/RenameClassConstFetchRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameClassConstFetchRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const CLASS_CONSTANT_RENAME = 'constant_rename'; /** * @var RenameClassConstFetchInterface[] */ @@ -73,9 +68,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $renameClassConstFetches = $configuration[self::CLASS_CONSTANT_RENAME] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($renameClassConstFetches, \Rector\Renaming\Contract\RenameClassConstFetchInterface::class); - $this->renameClassConstFetches = $renameClassConstFetches; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\Contract\RenameClassConstFetchInterface::class); + $this->renameClassConstFetches = $configuration; } private function createClassAndConstFetch(\Rector\Renaming\ValueObject\RenameClassAndConstFetch $renameClassAndConstFetch) : \PhpParser\Node\Expr\ClassConstFetch { diff --git a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php index dbbd9ea7438..3e04d958efe 100644 --- a/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php +++ b/rules/Renaming/Rector/ClassMethod/RenameAnnotationRector.php @@ -21,11 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameAnnotationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const RENAMED_ANNOTATIONS = 'renamed_annotations'; /** * @var RenameAnnotationInterface[] */ @@ -99,9 +94,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $renamedAnnotations = $configuration[self::RENAMED_ANNOTATIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($renamedAnnotations); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($renamedAnnotations, \Rector\Renaming\Contract\RenameAnnotationInterface::class); - $this->renameAnnotations = $renamedAnnotations; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\Contract\RenameAnnotationInterface::class); + $this->renameAnnotations = $configuration; } } diff --git a/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php b/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php index 9f44b4aa17f..6b1b3483d80 100644 --- a/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php +++ b/rules/Renaming/Rector/ConstFetch/RenameConstantRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameConstantRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const OLD_TO_NEW_CONSTANTS = 'old_to_new_constants'; /** * @var array */ @@ -73,10 +68,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $oldToNewConstants = $configuration[self::OLD_TO_NEW_CONSTANTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($oldToNewConstants)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($oldToNewConstants); - /** @var array $oldToNewConstants */ - $this->oldToNewConstants = $oldToNewConstants; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var array $configuration */ + $this->oldToNewConstants = $configuration; } } diff --git a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php b/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php index 8b231d7f37a..4645b427718 100644 --- a/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php +++ b/rules/Renaming/Rector/FileWithoutNamespace/PseudoNamespaceToNamespaceRector.php @@ -27,11 +27,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class PseudoNamespaceToNamespaceRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES = 'namespace_prefixed_with_excluded_classes'; /** * @see https://regex101.com/r/chvLgs/1/ * @var string @@ -103,9 +98,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $namespacePrefixesWithExcludedClasses = $configuration[self::NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($namespacePrefixesWithExcludedClasses, \Rector\Renaming\ValueObject\PseudoNamespaceToNamespace::class); - $this->pseudoNamespacesToNamespaces = $namespacePrefixesWithExcludedClasses; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\ValueObject\PseudoNamespaceToNamespace::class); + $this->pseudoNamespacesToNamespaces = $configuration; } /** * @param Stmt[] $stmts diff --git a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php index 3facbc3f5bb..d0eb9bf696a 100644 --- a/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php +++ b/rules/Renaming/Rector/FuncCall/RenameFunctionRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameFunctionRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const OLD_FUNCTION_TO_NEW_FUNCTION = 'old_function_to_new_function'; /** * @var array */ @@ -62,11 +57,9 @@ final class RenameFunctionRector extends \Rector\Core\Rector\AbstractRector impl */ public function configure(array $configuration) : void { - $oldFunctionToNewFunction = $configuration[self::OLD_FUNCTION_TO_NEW_FUNCTION] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($oldFunctionToNewFunction); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_values($oldFunctionToNewFunction)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($oldFunctionToNewFunction); - $this->oldFunctionToNewFunction = $oldFunctionToNewFunction; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_values($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->oldFunctionToNewFunction = $configuration; } private function createName(string $newFunction) : \PhpParser\Node\Name { diff --git a/rules/Renaming/Rector/MethodCall/RenameMethodRector.php b/rules/Renaming/Rector/MethodCall/RenameMethodRector.php index 82c77bb49d7..2fbbfaea32a 100644 --- a/rules/Renaming/Rector/MethodCall/RenameMethodRector.php +++ b/rules/Renaming/Rector/MethodCall/RenameMethodRector.php @@ -26,11 +26,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameMethodRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_CALL_RENAMES = 'method_call_renames'; /** * @var MethodCallRenameInterface[] */ @@ -101,10 +96,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallRenames = $configuration[self::METHOD_CALL_RENAMES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodCallRenames, \Rector\Renaming\Contract\MethodCallRenameInterface::class); - $this->methodCallRenames = $methodCallRenames; - $this->methodCallRenameCollector->addMethodCallRenames($methodCallRenames); + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\Contract\MethodCallRenameInterface::class); + $this->methodCallRenames = $configuration; + $this->methodCallRenameCollector->addMethodCallRenames($configuration); } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Stmt\ClassMethod $node diff --git a/rules/Renaming/Rector/Name/RenameClassRector.php b/rules/Renaming/Rector/Name/RenameClassRector.php index 5df9d6ff3d7..d7d88c9323f 100644 --- a/rules/Renaming/Rector/Name/RenameClassRector.php +++ b/rules/Renaming/Rector/Name/RenameClassRector.php @@ -26,11 +26,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameClassRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const OLD_TO_NEW_CLASSES = 'old_to_new_classes'; /** * @readonly * @var \Rector\Core\Configuration\RenamedClassesDataCollector @@ -100,10 +95,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $oldToNewClasses = $configuration[self::OLD_TO_NEW_CLASSES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($oldToNewClasses); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($oldToNewClasses); - $this->addOldToNewClasses($oldToNewClasses); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->addOldToNewClasses($configuration); } /** * @param array $oldToNewClasses diff --git a/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php b/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php index 3cd9dc758dd..dbd12bdc457 100644 --- a/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php +++ b/rules/Renaming/Rector/Namespace_/RenameNamespaceRector.php @@ -23,11 +23,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameNamespaceRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const OLD_TO_NEW_NAMESPACES = 'old_to_new_namespaces'; /** * @var array */ @@ -101,11 +96,10 @@ final class RenameNamespaceRector extends \Rector\Core\Rector\AbstractRector imp */ public function configure(array $configuration) : void { - $oldToNewNamespaces = $configuration[self::OLD_TO_NEW_NAMESPACES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($oldToNewNamespaces)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($oldToNewNamespaces); - /** @var array $oldToNewNamespaces */ - $this->oldToNewNamespaces = $oldToNewNamespaces; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var array $configuration */ + $this->oldToNewNamespaces = $configuration; } private function processFullyQualified(\PhpParser\Node\Name $name, \Rector\Renaming\ValueObject\RenamedNamespace $renamedNamespace) : ?\PhpParser\Node\Name\FullyQualified { diff --git a/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php b/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php index 8750fa6d48d..4b1e0eefccb 100644 --- a/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php +++ b/rules/Renaming/Rector/PropertyFetch/RenamePropertyRector.php @@ -23,11 +23,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenamePropertyRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const RENAMED_PROPERTIES = 'old_to_new_property_by_types'; /** * @var RenameProperty[] */ @@ -58,9 +53,8 @@ final class RenamePropertyRector extends \Rector\Core\Rector\AbstractRector impl */ public function configure(array $configuration) : void { - $renamedProperties = $configuration[self::RENAMED_PROPERTIES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($renamedProperties, \Rector\Renaming\ValueObject\RenameProperty::class); - $this->renamedProperties = $renamedProperties; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\ValueObject\RenameProperty::class); + $this->renamedProperties = $configuration; } private function processFromClassLike(\PhpParser\Node\Stmt\ClassLike $classLike) : \PhpParser\Node\Stmt\ClassLike { diff --git a/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php b/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php index 13a80c8338a..82c46ea431e 100644 --- a/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php +++ b/rules/Renaming/Rector/StaticCall/RenameStaticMethodRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameStaticMethodRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const OLD_TO_NEW_METHODS_BY_CLASSES = 'old_to_new_method_by_classes'; /** * @var RenameStaticMethod[] */ @@ -59,9 +54,8 @@ final class RenameStaticMethodRector extends \Rector\Core\Rector\AbstractRector */ public function configure(array $configuration) : void { - $oldToNewMethodsByClasses = $configuration[self::OLD_TO_NEW_METHODS_BY_CLASSES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($oldToNewMethodsByClasses, \Rector\Renaming\ValueObject\RenameStaticMethod::class); - $this->staticMethodRenames = $oldToNewMethodsByClasses; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Renaming\ValueObject\RenameStaticMethod::class); + $this->staticMethodRenames = $configuration; } private function rename(\PhpParser\Node\Expr\StaticCall $staticCall, \Rector\Renaming\ValueObject\RenameStaticMethod $renameStaticMethod) : \PhpParser\Node\Expr\StaticCall { diff --git a/rules/Renaming/Rector/String_/RenameStringRector.php b/rules/Renaming/Rector/String_/RenameStringRector.php index 8a189308ac7..41aedf42803 100644 --- a/rules/Renaming/Rector/String_/RenameStringRector.php +++ b/rules/Renaming/Rector/String_/RenameStringRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class RenameStringRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const STRING_CHANGES = 'string_changes'; /** * @var array */ @@ -73,10 +68,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $stringChanges = $configuration[self::STRING_CHANGES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($stringChanges); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($stringChanges)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($stringChanges); - $this->stringChanges = $stringChanges; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->stringChanges = $configuration; } } diff --git a/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php b/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php index 209ac81e842..a54db389692 100644 --- a/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php +++ b/rules/Restoration/Rector/Namespace_/CompleteImportForPartialAnnotationRector.php @@ -21,12 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class CompleteImportForPartialAnnotationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const USE_IMPORTS_TO_RESTORE = '$useImportsToRestore'; /** * @var CompleteImportForPartialAnnotation[] */ @@ -86,10 +80,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $useImportsToRestore = $configuration[self::USE_IMPORTS_TO_RESTORE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($useImportsToRestore, \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation::class); + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation::class); $default = [new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('Doctrine\\ORM\\Mapping', 'ORM'), new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('Symfony\\Component\\Validator\\Constraints', 'Assert'), new \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation('JMS\\Serializer\\Annotation', 'Serializer')]; - $this->useImportsToRestore = \array_merge($useImportsToRestore, $default); + $this->useImportsToRestore = \array_merge($configuration, $default); } private function addImportToNamespaceIfMissing(\PhpParser\Node\Stmt\Namespace_ $namespace, \Rector\Restoration\ValueObject\CompleteImportForPartialAnnotation $completeImportForPartialAnnotation) : \PhpParser\Node\Stmt\Namespace_ { diff --git a/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php b/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php index 6700d95e01f..508acff3f66 100644 --- a/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/DimFetchAssignToMethodCallRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class DimFetchAssignToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const DIM_FETCH_ASSIGN_TO_METHOD_CALL = 'dim_fetch_assign_to_method_call'; /** * @var DimFetchAssignToMethodCall[] */ @@ -91,9 +86,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $dimFetchAssignToMethodCalls = $configuration[self::DIM_FETCH_ASSIGN_TO_METHOD_CALL] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($dimFetchAssignToMethodCalls, \Rector\Transform\ValueObject\DimFetchAssignToMethodCall::class); - $this->dimFetchAssignToMethodCalls = $dimFetchAssignToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\DimFetchAssignToMethodCall::class); + $this->dimFetchAssignToMethodCalls = $configuration; } private function findDimFetchAssignToMethodCall(\PhpParser\Node\Expr\Assign $assign) : ?\Rector\Transform\ValueObject\DimFetchAssignToMethodCall { diff --git a/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php b/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php index 4e062047c6f..41e89fc417d 100644 --- a/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/GetAndSetToMethodCallRector.php @@ -24,11 +24,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class GetAndSetToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const TYPE_TO_METHOD_CALLS = 'type_to_method_calls'; /** * @var GetAndSetToMethodCall[] */ @@ -85,9 +80,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $getAndSetToMethodCalls = $configuration[self::TYPE_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($getAndSetToMethodCalls, \Rector\Transform\ValueObject\GetAndSetToMethodCall::class); - $this->getAndSetToMethodCalls = $getAndSetToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\GetAndSetToMethodCall::class); + $this->getAndSetToMethodCalls = $configuration; } private function processMagicSet(\PhpParser\Node\Expr $expr, \PhpParser\Node\Expr\PropertyFetch $propertyFetch) : ?\PhpParser\Node { diff --git a/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php b/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php index c0490c07161..e52b8286354 100644 --- a/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/PropertyAssignToMethodCallRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class PropertyAssignToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PROPERTY_ASSIGNS_TO_METHODS_CALLS = 'property_assigns_to_methods_calls'; /** * @var PropertyAssignToMethodCall[] */ @@ -73,8 +68,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $propertyAssignsToMethodCalls = $configuration[self::PROPERTY_ASSIGNS_TO_METHODS_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($propertyAssignsToMethodCalls, \Rector\Transform\ValueObject\PropertyAssignToMethodCall::class); - $this->propertyAssignsToMethodCalls = $propertyAssignsToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\PropertyAssignToMethodCall::class); + $this->propertyAssignsToMethodCalls = $configuration; } } diff --git a/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php b/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php index 2142440ec9e..9a25aa6b337 100644 --- a/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php +++ b/rules/Transform/Rector/Assign/PropertyFetchToMethodCallRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class PropertyFetchToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PROPERTIES_TO_METHOD_CALLS = 'properties_to_method_calls'; /** * @var PropertyFetchToMethodCall[] */ @@ -69,9 +64,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $propertiesToMethodCalls = $configuration[self::PROPERTIES_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($propertiesToMethodCalls, \Rector\Transform\ValueObject\PropertyFetchToMethodCall::class); - $this->propertiesToMethodCalls = $propertiesToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\PropertyFetchToMethodCall::class); + $this->propertiesToMethodCalls = $configuration; } private function processSetter(\PhpParser\Node\Expr\Assign $assign) : ?\PhpParser\Node { diff --git a/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php b/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php index 7883cc13525..d280a9ebedf 100644 --- a/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php +++ b/rules/Transform/Rector/Attribute/AttributeKeyToClassConstFetchRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AttributeKeyToClassConstFetchRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ATTRIBUTE_KEYS_TO_CLASS_CONST_FETCHES = 'attribute_keys_to_class_const_fetches'; /** * @var AttributeKeyToClassConstFetch[] */ @@ -91,8 +86,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $attributeKeysToClassConstFetches = $configuration[self::ATTRIBUTE_KEYS_TO_CLASS_CONST_FETCHES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($attributeKeysToClassConstFetches, \Rector\Transform\ValueObject\AttributeKeyToClassConstFetch::class); - $this->attributeKeysToClassConstFetches = $attributeKeysToClassConstFetches; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\AttributeKeyToClassConstFetch::class); + $this->attributeKeysToClassConstFetches = $configuration; } } diff --git a/rules/Transform/Rector/ClassMethod/WrapReturnRector.php b/rules/Transform/Rector/ClassMethod/WrapReturnRector.php index 1c5a7432d67..baf526d74ab 100644 --- a/rules/Transform/Rector/ClassMethod/WrapReturnRector.php +++ b/rules/Transform/Rector/ClassMethod/WrapReturnRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class WrapReturnRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const TYPE_METHOD_WRAPS = 'type_method_wraps'; /** * @var WrapReturn[] */ @@ -81,9 +76,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $typeMethodWraps = $configuration[self::TYPE_METHOD_WRAPS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($typeMethodWraps, \Rector\Transform\ValueObject\WrapReturn::class); - $this->typeMethodWraps = $typeMethodWraps; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\WrapReturn::class); + $this->typeMethodWraps = $configuration; } private function wrap(\PhpParser\Node\Stmt\ClassMethod $classMethod, bool $isArrayWrap) : ?\PhpParser\Node\Stmt\ClassMethod { diff --git a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php index e065d373c33..d8bfd21b735 100644 --- a/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php +++ b/rules/Transform/Rector/Class_/AddInterfaceByParentRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddInterfaceByParentRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const INTERFACE_BY_PARENT = 'interface_by_parent'; /** * @var array */ @@ -84,10 +79,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $interfaceByParent = $configuration[self::INTERFACE_BY_PARENT] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($interfaceByParent); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($interfaceByParent)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($interfaceByParent); - $this->interfaceByParent = $interfaceByParent; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->interfaceByParent = $configuration; } } diff --git a/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php b/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php index 05f3817c5ee..25269a0655e 100644 --- a/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php +++ b/rules/Transform/Rector/Class_/AddInterfaceByTraitRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddInterfaceByTraitRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const INTERFACE_BY_TRAIT = 'interface_by_trait'; /** * @var array */ @@ -81,10 +76,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $interfaceByTrait = $configuration[self::INTERFACE_BY_TRAIT] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($interfaceByTrait); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($interfaceByTrait)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($interfaceByTrait); - $this->interfaceByTrait = $interfaceByTrait; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->interfaceByTrait = $configuration; } } diff --git a/rules/Transform/Rector/Class_/MergeInterfacesRector.php b/rules/Transform/Rector/Class_/MergeInterfacesRector.php index 4b91db2b9e9..8eef76400c1 100644 --- a/rules/Transform/Rector/Class_/MergeInterfacesRector.php +++ b/rules/Transform/Rector/Class_/MergeInterfacesRector.php @@ -20,12 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MergeInterfacesRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const OLD_TO_NEW_INTERFACES = 'old_to_new_interfaces'; /** * @var array */ @@ -75,11 +69,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $oldToNewInterfaces = $configuration[self::OLD_TO_NEW_INTERFACES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($oldToNewInterfaces); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($oldToNewInterfaces)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($oldToNewInterfaces); - $this->oldToNewInterfaces = $oldToNewInterfaces; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->oldToNewInterfaces = $configuration; } private function makeImplementsUnique(\PhpParser\Node\Stmt\Class_ $class) : void { diff --git a/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php b/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php index 98367db9e36..860bd3ec7cf 100644 --- a/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php +++ b/rules/Transform/Rector/Class_/ParentClassToTraitsRector.php @@ -23,11 +23,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ParentClassToTraitsRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PARENT_CLASS_TO_TRAITS = 'parent_class_to_traits'; /** * @var ParentClassToTraits[] */ @@ -98,9 +93,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $parentClassToTraits = $configuration[self::PARENT_CLASS_TO_TRAITS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($parentClassToTraits, \Rector\Transform\ValueObject\ParentClassToTraits::class); - $this->parentClassToTraits = $parentClassToTraits; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\ParentClassToTraits::class); + $this->parentClassToTraits = $configuration; } private function removeParentClass(\PhpParser\Node\Stmt\Class_ $class) : void { diff --git a/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php b/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php index 1ae6935cfbf..2c7332c2480 100644 --- a/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php +++ b/rules/Transform/Rector/FuncCall/ArgumentFuncCallToMethodCallRector.php @@ -30,11 +30,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ArgumentFuncCallToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNCTIONS_TO_METHOD_CALLS = 'functions_to_method_calls'; /** * @var ArgumentFuncCallToMethodCallInterface[] */ @@ -129,10 +124,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $functionToMethodCalls = $configuration[self::FUNCTIONS_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($functionToMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($functionToMethodCalls, \Rector\Transform\Contract\ValueObject\ArgumentFuncCallToMethodCallInterface::class); - $this->argumentFuncCallToMethodCalls = $functionToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\Contract\ValueObject\ArgumentFuncCallToMethodCallInterface::class); + $this->argumentFuncCallToMethodCalls = $configuration; } private function shouldSkipFuncCall(\PhpParser\Node\Expr\FuncCall $funcCall) : bool { diff --git a/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php b/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php index c8b079f8e36..63ed614b139 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToConstFetchRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class FuncCallToConstFetchRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNCTIONS_TO_CONSTANTS = 'functions_to_constants'; /** * @var string[] */ @@ -74,11 +69,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $functionsToConstants = $configuration[self::FUNCTIONS_TO_CONSTANTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($functionsToConstants); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($functionsToConstants); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($functionsToConstants)); - /** @var array $functionsToConstants */ - $this->functionsToConstants = $functionsToConstants; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + /** @var array $configuration */ + $this->functionsToConstants = $configuration; } } diff --git a/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php b/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php index 32ad343a8ad..47ce9295612 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToMethodCallRector.php @@ -19,11 +19,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class FuncCallToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNC_CALL_TO_CLASS_METHOD_CALL = 'function_to_class_to_method_call'; /** * @var FuncCallToMethodCall[] */ @@ -106,9 +101,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $funcCallsToClassMethodCalls = $configuration[self::FUNC_CALL_TO_CLASS_METHOD_CALL] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($funcCallsToClassMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($funcCallsToClassMethodCalls, \Rector\Transform\ValueObject\FuncCallToMethodCall::class); - $this->funcNameToMethodCallNames = $funcCallsToClassMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\FuncCallToMethodCall::class); + $this->funcNameToMethodCallNames = $configuration; } } diff --git a/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php b/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php index dbdca9ed513..eb9adbc1e44 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToNewRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class FuncCallToNewRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNCTIONS_TO_NEWS = 'functions_to_news'; /** * @var string[] */ @@ -73,9 +68,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $functionsToNews = $configuration[self::FUNCTIONS_TO_NEWS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($functionsToNews); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($functionsToNews); - $this->functionToNew = $functionsToNews; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + $this->functionToNew = $configuration; } } diff --git a/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php b/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php index 147c66124c9..8bc4bf22626 100644 --- a/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php +++ b/rules/Transform/Rector/FuncCall/FuncCallToStaticCallRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class FuncCallToStaticCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const FUNC_CALLS_TO_STATIC_CALLS = 'func_calls_to_static_calls'; /** * @var FuncCallToStaticCall[] */ @@ -54,9 +49,7 @@ final class FuncCallToStaticCallRector extends \Rector\Core\Rector\AbstractRecto */ public function configure(array $configuration) : void { - $funcCallsToStaticCalls = $configuration[self::FUNC_CALLS_TO_STATIC_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($funcCallsToStaticCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($funcCallsToStaticCalls, \Rector\Transform\ValueObject\FuncCallToStaticCall::class); - $this->funcCallsToStaticCalls = $funcCallsToStaticCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\FuncCallToStaticCall::class); + $this->funcCallsToStaticCalls = $configuration; } } diff --git a/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php b/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php index e209ba6273c..6578cb4f0c1 100644 --- a/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php +++ b/rules/Transform/Rector/Isset_/UnsetAndIssetToMethodCallRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class UnsetAndIssetToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const ISSET_UNSET_TO_METHOD_CALL = 'isset_unset_to_method_call'; /** * @var UnsetAndIssetToMethodCall[] */ @@ -74,10 +69,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $issetUnsetToMethodCalls = $configuration[self::ISSET_UNSET_TO_METHOD_CALL] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($issetUnsetToMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($issetUnsetToMethodCalls, \Rector\Transform\ValueObject\UnsetAndIssetToMethodCall::class); - $this->issetUnsetToMethodCalls = $issetUnsetToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\UnsetAndIssetToMethodCall::class); + $this->issetUnsetToMethodCalls = $configuration; } private function processArrayDimFetchNode(\PhpParser\Node $node, \PhpParser\Node\Expr\ArrayDimFetch $arrayDimFetch, \Rector\Transform\ValueObject\UnsetAndIssetToMethodCall $unsetAndIssetToMethodCall) : ?\PhpParser\Node { diff --git a/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php b/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php index d57bf4195ea..b8fac199d08 100644 --- a/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php +++ b/rules/Transform/Rector/MethodCall/CallableInMethodCallToVariableRector.php @@ -22,11 +22,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class CallableInMethodCallToVariableRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const CALLABLE_IN_METHOD_CALL_TO_VARIABLE = 'callable_in_method_call_to_variable'; /** * @var CallableInMethodCallToVariable[] */ @@ -108,9 +103,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $callableInMethodCallToVariable = $configuration[self::CALLABLE_IN_METHOD_CALL_TO_VARIABLE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($callableInMethodCallToVariable); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($callableInMethodCallToVariable, \Rector\Transform\ValueObject\CallableInMethodCallToVariable::class); - $this->callableInMethodCallToVariable = $callableInMethodCallToVariable; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\CallableInMethodCallToVariable::class); + $this->callableInMethodCallToVariable = $configuration; } } diff --git a/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php b/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php index b0969dbb1b6..138e3a1a1ce 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php @@ -17,11 +17,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MethodCallToAnotherMethodCallWithArgumentsRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_CALL_RENAMES_WITH_ADDED_ARGUMENTS = 'method_call_renames_with_added_arguments'; /** * @var MethodCallToAnotherMethodCallWithArguments[] */ @@ -68,9 +63,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallRenamesWithAddedArguments = $configuration[self::METHOD_CALL_RENAMES_WITH_ADDED_ARGUMENTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($methodCallRenamesWithAddedArguments); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodCallRenamesWithAddedArguments, \Rector\Transform\ValueObject\MethodCallToAnotherMethodCallWithArguments::class); - $this->methodCallRenamesWithAddedArguments = $methodCallRenamesWithAddedArguments; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\MethodCallToAnotherMethodCallWithArguments::class); + $this->methodCallRenamesWithAddedArguments = $configuration; } } diff --git a/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php b/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php index eab4c4d6837..b145a7440e3 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToMethodCallRector.php @@ -24,11 +24,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MethodCallToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_CALLS_TO_METHOD_CALLS = 'method_calls_to_method_calls'; /** * @var MethodCallToMethodCall[] */ @@ -130,9 +125,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallsToMethodsCalls = $configuration[self::METHOD_CALLS_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodCallsToMethodsCalls, \Rector\Transform\ValueObject\MethodCallToMethodCall::class); - $this->methodCallsToMethodsCalls = $methodCallsToMethodsCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\MethodCallToMethodCall::class); + $this->methodCallsToMethodsCalls = $configuration; } private function isMatch(\PhpParser\Node\Expr\MethodCall $methodCall, \Rector\Transform\ValueObject\MethodCallToMethodCall $methodCallToMethodCall) : bool { diff --git a/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php b/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php index d43992ce7de..4951632f8ab 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToPropertyFetchRector.php @@ -15,12 +15,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MethodCallToPropertyFetchRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const METHOD_CALL_TO_PROPERTY_FETCHES = 'method_call_to_property_fetch_collection'; /** * @var array */ @@ -72,10 +66,9 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallToPropertyFetchCollection = $configuration[self::METHOD_CALL_TO_PROPERTY_FETCHES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($methodCallToPropertyFetchCollection)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($methodCallToPropertyFetchCollection); - /** @var array $methodCallToPropertyFetchCollection */ - $this->methodCallToPropertyFetchCollection = $methodCallToPropertyFetchCollection; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var array $configuration */ + $this->methodCallToPropertyFetchCollection = $configuration; } } diff --git a/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php b/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php index f1cb17bbd11..05e086c470c 100644 --- a/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php +++ b/rules/Transform/Rector/MethodCall/MethodCallToStaticCallRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class MethodCallToStaticCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_CALLS_TO_STATIC_CALLS = 'method_calls_to_static_calls'; /** * @var MethodCallToStaticCall[] */ @@ -89,9 +84,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallsToStaticCalls = $configuration[self::METHOD_CALLS_TO_STATIC_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($methodCallsToStaticCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodCallsToStaticCalls, \Rector\Transform\ValueObject\MethodCallToStaticCall::class); - $this->methodCallsToStaticCalls = $methodCallsToStaticCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\MethodCallToStaticCall::class); + $this->methodCallsToStaticCalls = $configuration; } } diff --git a/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php b/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php index b0a7eccdad2..94eebee5d65 100644 --- a/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php +++ b/rules/Transform/Rector/MethodCall/ReplaceParentCallByPropertyCallRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ReplaceParentCallByPropertyCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PARENT_CALLS_TO_PROPERTIES = 'parent_calls_to_properties'; /** * @var ReplaceParentCallByPropertyCall[] */ @@ -76,8 +71,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $parentCallToProperties = $configuration[self::PARENT_CALLS_TO_PROPERTIES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($parentCallToProperties, \Rector\Transform\ValueObject\ReplaceParentCallByPropertyCall::class); - $this->parentCallToProperties = $parentCallToProperties; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\ReplaceParentCallByPropertyCall::class); + $this->parentCallToProperties = $configuration; } } diff --git a/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php b/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php index 92de8030b74..25170cb6114 100644 --- a/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php +++ b/rules/Transform/Rector/MethodCall/ServiceGetterToConstructorInjectionRector.php @@ -25,11 +25,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ServiceGetterToConstructorInjectionRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_CALL_TO_SERVICES = 'method_call_to_services'; /** * @var ServiceGetterToConstructorInjection[] */ @@ -162,9 +157,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodCallToServices = $configuration[self::METHOD_CALL_TO_SERVICES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($methodCallToServices); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodCallToServices, \Rector\Transform\ValueObject\ServiceGetterToConstructorInjection::class); - $this->methodCallToServices = $methodCallToServices; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\ServiceGetterToConstructorInjection::class); + $this->methodCallToServices = $configuration; } } diff --git a/rules/Transform/Rector/New_/NewArgToMethodCallRector.php b/rules/Transform/Rector/New_/NewArgToMethodCallRector.php index 48940910d79..507fed0d2b8 100644 --- a/rules/Transform/Rector/New_/NewArgToMethodCallRector.php +++ b/rules/Transform/Rector/New_/NewArgToMethodCallRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class NewArgToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const NEW_ARGS_TO_METHOD_CALLS = 'new_args_to_method_calls'; /** * @var NewArgToMethodCall[] */ @@ -88,9 +83,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $newArgsToMethodCalls = $configuration[self::NEW_ARGS_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($newArgsToMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($newArgsToMethodCalls, \Rector\Transform\ValueObject\NewArgToMethodCall::class); - $this->newArgsToMethodCalls = $newArgsToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\NewArgToMethodCall::class); + $this->newArgsToMethodCalls = $configuration; } } diff --git a/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php b/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php index 3b822ba6c20..3eecdc3c08c 100644 --- a/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php +++ b/rules/Transform/Rector/New_/NewToConstructorInjectionRector.php @@ -26,11 +26,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class NewToConstructorInjectionRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const TYPES_TO_CONSTRUCTOR_INJECTION = 'types_to_constructor_injection'; /** * @var ObjectType[] */ @@ -123,8 +118,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $typesToConstructorInjections = $configuration[self::TYPES_TO_CONSTRUCTOR_INJECTION] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($typesToConstructorInjections); + $typesToConstructorInjections = $configuration; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($typesToConstructorInjections); foreach ($typesToConstructorInjections as $typeToConstructorInjection) { $this->constructorInjectionObjectTypes[] = new \PHPStan\Type\ObjectType($typeToConstructorInjection); } diff --git a/rules/Transform/Rector/New_/NewToMethodCallRector.php b/rules/Transform/Rector/New_/NewToMethodCallRector.php index eb36691213c..eef0a0cf949 100644 --- a/rules/Transform/Rector/New_/NewToMethodCallRector.php +++ b/rules/Transform/Rector/New_/NewToMethodCallRector.php @@ -24,11 +24,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class NewToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const NEWS_TO_METHOD_CALLS = 'news_to_method_calls'; /** * @var NewToMethodCall[] */ @@ -119,10 +114,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $newsToMethodCalls = $configuration[self::NEWS_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($newsToMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($newsToMethodCalls, \Rector\Transform\ValueObject\NewToMethodCall::class); - $this->newsToMethodCalls = $newsToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\NewToMethodCall::class); + $this->newsToMethodCalls = $configuration; } private function getExistingFactoryPropertyName(\PhpParser\Node\Stmt\Class_ $class, \PHPStan\Type\ObjectType $factoryObjectType) : ?string { diff --git a/rules/Transform/Rector/New_/NewToStaticCallRector.php b/rules/Transform/Rector/New_/NewToStaticCallRector.php index 00b30785104..9d6cd8469d7 100644 --- a/rules/Transform/Rector/New_/NewToStaticCallRector.php +++ b/rules/Transform/Rector/New_/NewToStaticCallRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class NewToStaticCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const TYPE_TO_STATIC_CALLS = 'type_to_static_calls'; /** * @var NewToStaticCall[] */ @@ -72,9 +67,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $typeToStaticCalls = $configuration[self::TYPE_TO_STATIC_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($typeToStaticCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($typeToStaticCalls, \Rector\Transform\ValueObject\NewToStaticCall::class); - $this->typeToStaticCalls = $typeToStaticCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\NewToStaticCall::class); + $this->typeToStaticCalls = $configuration; } } diff --git a/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php b/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php index 540c6fb0cf8..345ba7bbcb2 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToFuncCallRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class StaticCallToFuncCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const STATIC_CALLS_TO_FUNCTIONS = 'static_calls_to_functions'; /** * @var StaticCallToFuncCall[] */ @@ -66,9 +61,7 @@ final class StaticCallToFuncCallRector extends \Rector\Core\Rector\AbstractRecto */ public function configure(array $configuration) : void { - $staticCallsToFunctions = $configuration[self::STATIC_CALLS_TO_FUNCTIONS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($staticCallsToFunctions); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($staticCallsToFunctions, \Rector\Transform\ValueObject\StaticCallToFuncCall::class); - $this->staticCallsToFunctions = $staticCallsToFunctions; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\StaticCallToFuncCall::class); + $this->staticCallsToFunctions = $configuration; } } diff --git a/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php b/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php index 121482e993f..808c06b92dd 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToMethodCallRector.php @@ -23,12 +23,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class StaticCallToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const STATIC_CALLS_TO_METHOD_CALLS = 'static_calls_to_method_calls'; /** * @var StaticCallToMethodCall[] */ @@ -123,10 +117,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $staticCallsToMethodCalls = $configuration[self::STATIC_CALLS_TO_METHOD_CALLS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($staticCallsToMethodCalls); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($staticCallsToMethodCalls, \Rector\Transform\ValueObject\StaticCallToMethodCall::class); - $this->staticCallsToMethodCalls = $staticCallsToMethodCalls; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\StaticCallToMethodCall::class); + $this->staticCallsToMethodCalls = $configuration; } private function refactorToInstanceCall(\PhpParser\Node\Expr\StaticCall $staticCall, \Rector\Transform\ValueObject\StaticCallToMethodCall $staticCallToMethodCall) : \PhpParser\Node\Expr\MethodCall { diff --git a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php index 8003e730988..bb2846032f7 100644 --- a/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php +++ b/rules/Transform/Rector/StaticCall/StaticCallToNewRector.php @@ -20,11 +20,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class StaticCallToNewRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const STATIC_CALLS_TO_NEWS = 'static_calls_to_news'; /** * @var StaticCallToNew[] */ @@ -83,8 +78,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $staticCallsToNews = $configuration[self::STATIC_CALLS_TO_NEWS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($staticCallsToNews, \Rector\Transform\ValueObject\StaticCallToNew::class); - $this->staticCallsToNews = $staticCallsToNews; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\StaticCallToNew::class); + $this->staticCallsToNews = $configuration; } } diff --git a/rules/Transform/Rector/String_/StringToClassConstantRector.php b/rules/Transform/Rector/String_/StringToClassConstantRector.php index 5b04989ddc1..e0e6c61c3fa 100644 --- a/rules/Transform/Rector/String_/StringToClassConstantRector.php +++ b/rules/Transform/Rector/String_/StringToClassConstantRector.php @@ -16,11 +16,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class StringToClassConstantRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const STRINGS_TO_CLASS_CONSTANTS = 'strings_to_class_constants'; /** * @var StringToClassConstant[] */ @@ -72,9 +67,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $stringToClassConstants = $configuration[self::STRINGS_TO_CLASS_CONSTANTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($stringToClassConstants); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($stringToClassConstants, \Rector\Transform\ValueObject\StringToClassConstant::class); - $this->stringsToClassConstants = $stringToClassConstants; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Transform\ValueObject\StringToClassConstant::class); + $this->stringsToClassConstants = $configuration; } } diff --git a/rules/Transform/Rector/String_/ToStringToMethodCallRector.php b/rules/Transform/Rector/String_/ToStringToMethodCallRector.php index 23e18e89708..2804d0a5398 100644 --- a/rules/Transform/Rector/String_/ToStringToMethodCallRector.php +++ b/rules/Transform/Rector/String_/ToStringToMethodCallRector.php @@ -18,12 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ToStringToMethodCallRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @api - * @deprecated - * @var string - */ - public const METHOD_NAMES_BY_TYPE = 'method_names_by_type'; /** * @var array */ @@ -64,11 +58,10 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodNamesByType = $configuration[self::METHOD_NAMES_BY_TYPE] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($methodNamesByType)); - \RectorPrefix20220218\Webmozart\Assert\Assert::allString($methodNamesByType); - /** @var array $methodNamesByType */ - $this->methodNamesByType = $methodNamesByType; + \RectorPrefix20220218\Webmozart\Assert\Assert::allString(\array_keys($configuration)); + \RectorPrefix20220218\Webmozart\Assert\Assert::allString($configuration); + /** @var array $configuration */ + $this->methodNamesByType = $configuration; } private function processStringNode(\PhpParser\Node\Expr\Cast\String_ $string) : ?\PhpParser\Node { diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php index a7e3c11d601..f04c97d059b 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeDeclarationRector.php @@ -26,11 +26,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddParamTypeDeclarationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const PARAMETER_TYPEHINTS = 'parameter_typehints'; /** * @var AddParamTypeDeclaration[] */ @@ -97,10 +92,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $parameterTypehints = $configuration[self::PARAMETER_TYPEHINTS] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($parameterTypehints); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($parameterTypehints, \Rector\TypeDeclaration\ValueObject\AddParamTypeDeclaration::class); - $this->addParamTypeDeclarations = $parameterTypehints; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\TypeDeclaration\ValueObject\AddParamTypeDeclaration::class); + $this->addParamTypeDeclarations = $configuration; } private function shouldSkip(\PhpParser\Node\Stmt\ClassMethod $classMethod) : bool { diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php index 722e1575260..bc77d63155b 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddReturnTypeDeclarationRector.php @@ -22,11 +22,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class AddReturnTypeDeclarationRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_RETURN_TYPES = 'method_return_types'; /** * @var AddReturnTypeDeclaration[] */ @@ -90,10 +85,8 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodReturnTypes = $configuration[self::METHOD_RETURN_TYPES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($methodReturnTypes); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodReturnTypes, \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration::class); - $this->methodReturnTypes = $methodReturnTypes; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration::class); + $this->methodReturnTypes = $configuration; } private function processClassMethodNodeWithTypehints(\PhpParser\Node\Stmt\ClassMethod $classMethod, \PHPStan\Type\Type $newType) : void { diff --git a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php index aa37872786c..dc627e2a09d 100644 --- a/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php +++ b/rules/Visibility/Rector/ClassConst/ChangeConstantVisibilityRector.php @@ -18,11 +18,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ChangeConstantVisibilityRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const CLASS_CONSTANT_VISIBILITY_CHANGES = 'class_constant_visibility_changes'; /** * @var ChangeConstantVisibility[] */ @@ -91,9 +86,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $classConstantVisibilityChanges = $configuration[self::CLASS_CONSTANT_VISIBILITY_CHANGES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($classConstantVisibilityChanges); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($classConstantVisibilityChanges, \Rector\Visibility\ValueObject\ChangeConstantVisibility::class); - $this->classConstantVisibilityChanges = $classConstantVisibilityChanges; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Visibility\ValueObject\ChangeConstantVisibility::class); + $this->classConstantVisibilityChanges = $configuration; } } diff --git a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php index b04022f1c05..d4e891f9025 100644 --- a/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php +++ b/rules/Visibility/Rector/ClassMethod/ChangeMethodVisibilityRector.php @@ -21,11 +21,6 @@ use RectorPrefix20220218\Webmozart\Assert\Assert; */ final class ChangeMethodVisibilityRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface { - /** - * @deprecated - * @var string - */ - public const METHOD_VISIBILITIES = 'method_visibilities'; /** * @var ChangeMethodVisibility[] */ @@ -116,9 +111,7 @@ CODE_SAMPLE */ public function configure(array $configuration) : void { - $methodVisibilities = $configuration[self::METHOD_VISIBILITIES] ?? $configuration; - \RectorPrefix20220218\Webmozart\Assert\Assert::isArray($methodVisibilities); - \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($methodVisibilities, \Rector\Visibility\ValueObject\ChangeMethodVisibility::class); - $this->methodVisibilities = $methodVisibilities; + \RectorPrefix20220218\Webmozart\Assert\Assert::allIsAOf($configuration, \Rector\Visibility\ValueObject\ChangeMethodVisibility::class); + $this->methodVisibilities = $configuration; } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 18e518f38d6..159cbb7af0d 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -16,11 +16,11 @@ final class VersionResolver /** * @var string */ - public const PACKAGE_VERSION = '1ed8242e4462ace3beabc12632d1f8f4638bd7c3'; + public const PACKAGE_VERSION = '9f98873278a129166bfe7b65829d09f5de76d679'; /** * @var string */ - public const RELEASE_DATE = '2022-02-18 01:00:33'; + public const RELEASE_DATE = '2022-02-18 02:39:44'; public static function resolvePackageVersion() : string { $process = new \RectorPrefix20220218\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__); diff --git a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php index 623cfb72ab2..db121fbcf05 100644 --- a/src/NonPhpFile/Rector/RenameClassNonPhpRector.php +++ b/src/NonPhpFile/Rector/RenameClassNonPhpRector.php @@ -14,11 +14,6 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use RectorPrefix20220218\Webmozart\Assert\Assert; final class RenameClassNonPhpRector implements \Rector\Core\Contract\Rector\NonPhpRectorInterface, \Symplify\RuleDocGenerator\Contract\ConfigurableRuleInterface, \Rector\Core\Contract\Rector\ConfigurableRectorInterface, \Rector\PostRector\Contract\Rector\ComplementaryRectorInterface { - /** - * @deprecated - * @var string - */ - public const RENAME_CLASSES = 'rename_classes'; /** * @see https://regex101.com/r/HKUFJD/7 * for "?renameClasses = $renameClasses; diff --git a/vendor/autoload.php b/vendor/autoload.php index b0aeb094ad7..e51c50d1a62 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec::getLoader(); +return ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 4a24af05505..3ce4a5971b8 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec +class ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd { private static $loader; @@ -22,15 +22,15 @@ class ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitcccf105135239365f6b7d34222334fcd::getInitializer($loader)); } else { $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { @@ -42,12 +42,12 @@ class ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec::$files; + $includeFiles = Composer\Autoload\ComposerStaticInitcccf105135239365f6b7d34222334fcd::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire6803c5aa61198f26a2560abb9252e1ec($fileIdentifier, $file); + composerRequirecccf105135239365f6b7d34222334fcd($fileIdentifier, $file); } return $loader; @@ -59,7 +59,7 @@ class ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec * @param string $file * @return void */ -function composerRequire6803c5aa61198f26a2560abb9252e1ec($fileIdentifier, $file) +function composerRequirecccf105135239365f6b7d34222334fcd($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 9d25181912a..492cd593969 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec +class ComposerStaticInitcccf105135239365f6b7d34222334fcd { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -3871,9 +3871,9 @@ class ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit6803c5aa61198f26a2560abb9252e1ec::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitcccf105135239365f6b7d34222334fcd::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitcccf105135239365f6b7d34222334fcd::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitcccf105135239365f6b7d34222334fcd::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/scoper-autoload.php b/vendor/scoper-autoload.php index 7ee999cb9ef..11b690f93ae 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('RectorPrefix20220218\AutoloadIncluder'); } -if (!class_exists('ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec', false) && !interface_exists('ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec', false) && !trait_exists('ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec', false)) { - spl_autoload_call('RectorPrefix20220218\ComposerAutoloaderInit6803c5aa61198f26a2560abb9252e1ec'); +if (!class_exists('ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd', false) && !interface_exists('ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd', false) && !trait_exists('ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd', false)) { + spl_autoload_call('RectorPrefix20220218\ComposerAutoloaderInitcccf105135239365f6b7d34222334fcd'); } 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('RectorPrefix20220218\Helmich\TypoScriptParser\Parser\AST\Statement'); @@ -59,9 +59,9 @@ if (!function_exists('print_node')) { return \RectorPrefix20220218\print_node(...func_get_args()); } } -if (!function_exists('composerRequire6803c5aa61198f26a2560abb9252e1ec')) { - function composerRequire6803c5aa61198f26a2560abb9252e1ec() { - return \RectorPrefix20220218\composerRequire6803c5aa61198f26a2560abb9252e1ec(...func_get_args()); +if (!function_exists('composerRequirecccf105135239365f6b7d34222334fcd')) { + function composerRequirecccf105135239365f6b7d34222334fcd() { + return \RectorPrefix20220218\composerRequirecccf105135239365f6b7d34222334fcd(...func_get_args()); } } if (!function_exists('scanPath')) {