From 5fa8f3db73b357960ebcbeeb2ac7b19f12ae4af6 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 3 Aug 2026 15:38:06 +0200 Subject: [PATCH 1/2] [composer-based] Bond remaining 47 Symfony rules to their composer package version Every rule that was only reachable through a per-version set now declares the package and version its target API was added in, and is registered in the composer-based set as well. The per-version sets are left untouched. Rules bonded to a package that is not installed here, or installed below the bonded version, get a standalone composer.json in their test config, following the RedirectToRouteRector precedent. --- config/sets/symfony/composer-based.php | 194 +++++++++++++++++- ...engthSymfonyFormOptionToAttrRectorTest.php | 5 + .../config/composer.json | 5 + ...ptionNameFromTypeToEntryTypeRectorTest.php | 5 + .../config/composer.json | 5 + .../GetToConstructorInjectionRectorTest.php | 5 + .../config/composer.json | 5 + .../ParseFileRector/ParseFileRectorTest.php | 5 + .../ParseFileRector/config/composer.json | 5 + .../FormTypeGetParentRectorTest.php | 5 + .../config/composer.json | 5 + .../GetRequestRector/GetRequestRectorTest.php | 5 + .../GetRequestRector/config/composer.json | 5 + .../RemoveDefaultGetBlockPrefixRectorTest.php | 5 + .../config/composer.json | 5 + ...ngCollectionOptionToConstantRectorTest.php | 5 + .../config/composer.json | 5 + ...FormTypeInstanceToClassConstRectorTest.php | 5 + .../config/composer.json | 5 + .../OptionNameRector/OptionNameRectorTest.php | 5 + .../OptionNameRector/config/composer.json | 5 + .../ReadOnlyOptionToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + .../StringFormTypeToClassRectorTest.php | 5 + .../WithContainerTest.php | 5 + .../config/composer.json | 5 + ...xceptionToErrorEventConstantRectorTest.php | 5 + .../config/composer.json | 5 + ...dAnnotationToRouteAnnotationRectorTest.php | 5 + .../config/composer.json | 5 + ...RemoveServiceFromSensioRouteRectorTest.php | 5 + .../config/composer.json | 5 + ...ioRouteAnnotationWithSymfonyRectorTest.php | 5 + .../config/composer.json | 5 + ...ontainerGetNameToTypeInTestsRectorTest.php | 5 + .../config/composer.json | 5 + .../ConstraintUrlOptionRectorTest.php | 5 + .../config/composer.json | 5 + ...nerBuilderCompileEnvArgumentRectorTest.php | 5 + .../config/composer.json | 5 + .../FormIsValidRectorTest.php | 5 + .../FormIsValidRector/config/composer.json | 5 + ...VarDumperTestTraitMethodArgsRectorTest.php | 5 + .../config/composer.json | 5 + ...eShortNotationToBundleSyntaxRectorTest.php | 5 + .../config/composer.json | 5 + ...rencyBundleMethodCallsToIntlRectorTest.php | 5 + .../config/composer.json | 5 + ...BundleFilesystemLoaderToTwigRectorTest.php | 5 + .../config/composer.json | 5 + ...BuilderToRoutingConfiguratorRectorTest.php | 5 + .../config/composer.json | 5 + .../FormBuilderSetDataMapperRectorTest.php | 5 + .../config/composer.json | 5 + ...opertyPathMapperToDataMapperRectorTest.php | 5 + .../config/composer.json | 5 + ...ContainerPropertyDeprecationRectorTest.php | 5 + .../config/composer.json | 5 + ...GetHelperControllerToServiceRectorTest.php | 5 + .../config/composer.json | 5 + .../CommandConfigureToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + .../CommandPropertyToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...ttributeToMapEntityAttributeRectorTest.php | 5 + .../config/composer.json | 5 + .../MessageHandlerToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...bscriberInterfaceToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...estToRequestStackConstructorRectorTest.php | 5 + .../config/composer.json | 5 + ...oteArgumentToVoteOnAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...AccessDecisionManagerInVoterRectorTest.php | 5 + .../config/composer.json | 5 + ...criptionToAsCommandAttributeRectorTest.php | 5 + .../config/composer.json | 5 + .../CommandHelpToAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...raintOptionsToNamedArgumentsRectorTest.php | 5 + .../config/composer.json | 5 + ...ltersToAsTwigFilterAttributeRectorTest.php | 5 + .../config/composer.json | 5 + ...onsToAsTwigFunctionAttributeRectorTest.php | 5 + .../config/composer.json | 5 + .../RemoveEraseCredentialsRectorTest.php | 5 + .../config/composer.json | 5 + ...rValidateToValidateInContextRectorTest.php | 5 + .../config/composer.json | 5 + ...indowsOptionToFollowSymlinksRectorTest.php | 5 + .../config/composer.json | 5 + ...ialsFromAuthenticatorManagerRectorTest.php | 5 + .../config/composer.json | 5 + .../AddFormatArgumentToIsValidRectorTest.php | 5 + .../config/composer.json | 5 + ...MaxLengthSymfonyFormOptionToAttrRector.php | 9 +- ...ypeOptionNameFromTypeToEntryTypeRector.php | 9 +- .../GetToConstructorInjectionRector.php | 9 +- .../Rector/StaticCall/ParseFileRector.php | 9 +- .../ClassMethod/FormTypeGetParentRector.php | 9 +- .../Rector/ClassMethod/GetRequestRector.php | 9 +- .../RemoveDefaultGetBlockPrefixRector.php | 9 +- ...StringCollectionOptionToConstantRector.php | 9 +- .../FormTypeInstanceToClassConstRector.php | 9 +- .../Rector/MethodCall/OptionNameRector.php | 9 +- .../ReadOnlyOptionToAttributeRector.php | 9 +- .../StringFormTypeToClassRector.php | 9 +- ...oleExceptionToErrorEventConstantRector.php | 9 +- ...ethodAnnotationToRouteAnnotationRector.php | 9 +- .../RemoveServiceFromSensioRouteRector.php | 9 +- ...SensioRouteAnnotationWithSymfonyRector.php | 9 +- .../ContainerGetNameToTypeInTestsRector.php | 9 +- .../ConstFetch/ConstraintUrlOptionRector.php | 9 +- ...ntainerBuilderCompileEnvArgumentRector.php | 9 +- .../Rector/MethodCall/FormIsValidRector.php | 9 +- .../VarDumperTestTraitMethodArgsRector.php | 9 +- ...plateShortNotationToBundleSyntaxRector.php | 9 +- ...tCurrencyBundleMethodCallsToIntlRector.php | 9 +- ...TwigBundleFilesystemLoaderToTwigRector.php | 9 +- ...tionBuilderToRoutingConfiguratorRector.php | 9 +- .../FormBuilderSetDataMapperRector.php | 9 +- .../PropertyPathMapperToDataMapperRector.php | 9 +- ...CaseContainerPropertyDeprecationRector.php | 9 +- .../GetHelperControllerToServiceRector.php | 9 +- .../CommandConfigureToAttributeRector.php | 9 +- .../CommandPropertyToAttributeRector.php | 9 +- ...terAttributeToMapEntityAttributeRector.php | 9 +- ...ssageHandlerInterfaceToAttributeRector.php | 9 +- ...geSubscriberInterfaceToAttributeRector.php | 9 +- ...RequestToRequestStackConstructorRector.php | 9 +- ...AddVoteArgumentToVoteOnAttributeRector.php | 9 +- ...erToAccessDecisionManagerInVoterRector.php | 9 +- ...dDescriptionToAsCommandAttributeRector.php | 9 +- .../Class_/CommandHelpToAttributeRector.php | 9 +- ...onstraintOptionsToNamedArgumentsRector.php | 9 +- ...etFiltersToAsTwigFilterAttributeRector.php | 9 +- ...nctionsToAsTwigFunctionAttributeRector.php | 9 +- .../Class_/RemoveEraseCredentialsRector.php | 9 +- ...datorValidateToValidateInContextRector.php | 9 +- ...yOnWindowsOptionToFollowSymlinksRector.php | 9 +- ...dentialsFromAuthenticatorManagerRector.php | 9 +- .../AddFormatArgumentToIsValidRector.php | 9 +- 143 files changed, 1035 insertions(+), 57 deletions(-) create mode 100644 rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/composer.json create mode 100644 rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/composer.json create mode 100644 rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/composer.json create mode 100644 rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/composer.json create mode 100644 rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/composer.json create mode 100644 rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/composer.json create mode 100644 rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/composer.json create mode 100644 rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/composer.json create mode 100644 rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/composer.json create mode 100644 rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/composer.json create mode 100644 rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/composer.json create mode 100644 rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/composer.json create mode 100644 rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/composer.json create mode 100644 rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/composer.json create mode 100644 rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/config/composer.json create mode 100644 rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/composer.json create mode 100644 rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/composer.json create mode 100644 rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/composer.json create mode 100644 rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/composer.json create mode 100644 rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/composer.json create mode 100644 rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/composer.json create mode 100644 rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/config/composer.json create mode 100644 rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/config/composer.json create mode 100644 rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/config/composer.json create mode 100644 rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/config/composer.json create mode 100644 rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/config/composer.json create mode 100644 rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/config/composer.json diff --git a/config/sets/symfony/composer-based.php b/config/sets/symfony/composer-based.php index 377bc6507..9538fcf46 100644 --- a/config/sets/symfony/composer-based.php +++ b/config/sets/symfony/composer-based.php @@ -43,27 +43,74 @@ use Rector\Symfony\CodeQuality\Rector\AttributeGroup\SingleConditionSecurityAttributeToIsGrantedRector; use Rector\Symfony\CodeQuality\Rector\Class_\SplitAndSecurityAttributeToIsGrantedRector; use Rector\Symfony\Symfony25\Rector\MethodCall\AddViolationToBuildViolationRector; +use Rector\Symfony\Symfony25\Rector\MethodCall\MaxLengthSymfonyFormOptionToAttrRector; use Rector\Symfony\Symfony26\Rector\MethodCall\RedirectToRouteRector; +use Rector\Symfony\Symfony27\Rector\MethodCall\ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector; +use Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector; +use Rector\Symfony\Symfony28\Rector\StaticCall\ParseFileRector; +use Rector\Symfony\Symfony30\Rector\ClassMethod\FormTypeGetParentRector; +use Rector\Symfony\Symfony30\Rector\ClassMethod\GetRequestRector; +use Rector\Symfony\Symfony30\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector; +use Rector\Symfony\Symfony30\Rector\MethodCall\ChangeStringCollectionOptionToConstantRector; +use Rector\Symfony\Symfony30\Rector\MethodCall\FormTypeInstanceToClassConstRector; +use Rector\Symfony\Symfony30\Rector\MethodCall\OptionNameRector; +use Rector\Symfony\Symfony30\Rector\MethodCall\ReadOnlyOptionToAttributeRector; +use Rector\Symfony\Symfony30\Rector\MethodCall\StringFormTypeToClassRector; +use Rector\Symfony\Symfony33\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector; +use Rector\Symfony\Symfony34\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector; +use Rector\Symfony\Symfony34\Rector\ClassMethod\RemoveServiceFromSensioRouteRector; +use Rector\Symfony\Symfony34\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector; +use Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector; +use Rector\Symfony\Symfony40\Rector\ConstFetch\ConstraintUrlOptionRector; +use Rector\Symfony\Symfony40\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector; +use Rector\Symfony\Symfony40\Rector\MethodCall\FormIsValidRector; +use Rector\Symfony\Symfony40\Rector\MethodCall\VarDumperTestTraitMethodArgsRector; use Rector\Symfony\Symfony42\Rector\New_\RootNodeTreeBuilderRector; use Rector\Symfony\Symfony42\Rector\New_\StringToArrayArgumentProcessRector; use Rector\Symfony\Symfony43\Rector\ClassMethod\EventDispatcherParentConstructRector; +use Rector\Symfony\Symfony43\Rector\MethodCall\ConvertRenderTemplateShortNotationToBundleSyntaxRector; +use Rector\Symfony\Symfony43\Rector\MethodCall\GetCurrencyBundleMethodCallsToIntlRector; use Rector\Symfony\Symfony43\Rector\MethodCall\MakeDispatchFirstArgumentEventRector; +use Rector\Symfony\Symfony43\Rector\StmtsAwareInterface\TwigBundleFilesystemLoaderToTwigRector; use Rector\Symfony\Symfony44\Rector\ClassMethod\ConsoleExecuteReturnIntRector; use Rector\Symfony\Symfony44\Rector\MethodCall\AuthorizationCheckerIsGrantedExtractorRector; use Rector\Symfony\Symfony51\Rector\Class_\LogoutHandlerToLogoutEventSubscriberRector; use Rector\Symfony\Symfony51\Rector\Class_\LogoutSuccessHandlerToLogoutEventSubscriberRector; use Rector\Symfony\Symfony51\Rector\ClassMethod\CommandConstantReturnCodeRector; +use Rector\Symfony\Symfony51\Rector\ClassMethod\RouteCollectionBuilderToRoutingConfiguratorRector; use Rector\Symfony\Symfony52\Rector\MethodCall\DefinitionAliasSetPrivateToSetPublicRector; +use Rector\Symfony\Symfony52\Rector\MethodCall\FormBuilderSetDataMapperRector; use Rector\Symfony\Symfony52\Rector\MethodCall\ReflectionExtractorEnableMagicCallExtractorRector; use Rector\Symfony\Symfony52\Rector\MethodCall\ValidatorBuilderEnableAnnotationMappingRector; use Rector\Symfony\Symfony52\Rector\New_\PropertyAccessorCreationBooleanToFlagsRector; +use Rector\Symfony\Symfony52\Rector\New_\PropertyPathMapperToDataMapperRector; use Rector\Symfony\Symfony52\Rector\StaticCall\BinaryFileResponseCreateToNewInstanceRector; +use Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector; use Rector\Symfony\Symfony60\Rector\FuncCall\ReplaceServiceArgumentRector; +use Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector; +use Rector\Symfony\Symfony61\Rector\Class_\CommandConfigureToAttributeRector; +use Rector\Symfony\Symfony61\Rector\Class_\CommandPropertyToAttributeRector; use Rector\Symfony\Symfony61\Rector\StaticPropertyFetch\ErrorNamesPropertyToConstantRector; +use Rector\Symfony\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector; +use Rector\Symfony\Symfony62\Rector\Class_\MessageSubscriberInterfaceToAttributeRector; use Rector\Symfony\Symfony62\Rector\Class_\SecurityAttributeToIsGrantedAttributeRector; use Rector\Symfony\Symfony62\Rector\ClassMethod\ClassMethod\ArgumentValueResolverToValueResolverRector; +use Rector\Symfony\Symfony62\Rector\ClassMethod\ParamConverterAttributeToMapEntityAttributeRector; use Rector\Symfony\Symfony63\Rector\Class_\ParamAndEnvAttributeRector; use Rector\Symfony\Symfony63\Rector\Class_\SignalableCommandInterfaceReturnTypeRector; +use Rector\Symfony\Symfony72\Rector\StmtsAwareInterface\PushRequestToRequestStackConstructorRector; +use Rector\Symfony\Symfony73\Rector\Class_\AddVoteArgumentToVoteOnAttributeRector; +use Rector\Symfony\Symfony73\Rector\Class_\AuthorizationCheckerToAccessDecisionManagerInVoterRector; +use Rector\Symfony\Symfony73\Rector\Class_\CommandDefaultNameAndDescriptionToAsCommandAttributeRector; +use Rector\Symfony\Symfony73\Rector\Class_\CommandHelpToAttributeRector; +use Rector\Symfony\Symfony73\Rector\Class_\ConstraintOptionsToNamedArgumentsRector; +use Rector\Symfony\Symfony73\Rector\Class_\GetFiltersToAsTwigFilterAttributeRector; +use Rector\Symfony\Symfony73\Rector\Class_\GetFunctionsToAsTwigFunctionAttributeRector; +use Rector\Symfony\Symfony80\Rector\Class_\RemoveEraseCredentialsRector; +use Rector\Symfony\Symfony81\Rector\MethodCall\ConstraintValidatorValidateToValidateInContextRector; +use Rector\Symfony\Symfony81\Rector\MethodCall\RenameCopyOnWindowsOptionToFollowSymlinksRector; +use Rector\Symfony\Symfony81\Rector\New_\RemoveEraseCredentialsFromAuthenticatorManagerRector; +use Rector\Symfony\Symfony81\Rector\StaticCall\AddFormatArgumentToIsValidRector; use Rector\Symfony\ValueObject\ReplaceServiceArgument; use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector; use Rector\Transform\Rector\ClassMethod\WrapReturnRector; @@ -93,12 +140,59 @@ // each of these rules declares the exact Symfony package and the version its target API was added in, // @see ComposerPackageConstraintInterface $rectorConfig->rules([ + // symfony/form 2.5 + MaxLengthSymfonyFormOptionToAttrRector::class, + // symfony/validator 2.5 AddViolationToBuildViolationRector::class, // symfony/framework-bundle 2.6 RedirectToRouteRector::class, + // symfony/form 2.7 + ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector::class, + + // symfony/framework-bundle 2.8 + GetToConstructorInjectionRector::class, + + // symfony/yaml 2.8 + ParseFileRector::class, + + // symfony/form 3.0 + ChangeStringCollectionOptionToConstantRector::class, + FormTypeGetParentRector::class, + OptionNameRector::class, + ReadOnlyOptionToAttributeRector::class, + RemoveDefaultGetBlockPrefixRector::class, + StringFormTypeToClassRector::class, + + // symfony/framework-bundle 3.0 + FormTypeInstanceToClassConstRector::class, + GetRequestRector::class, + + // symfony/console 3.3 + ConsoleExceptionToErrorEventConstantRector::class, + + // symfony/dependency-injection 3.4 + ContainerGetNameToTypeInTestsRector::class, + + // symfony/routing 3.4 + MergeMethodAnnotationToRouteAnnotationRector::class, + RemoveServiceFromSensioRouteRector::class, + ReplaceSensioRouteAnnotationWithSymfonyRector::class, + + // symfony/dependency-injection 4.0 + ContainerBuilderCompileEnvArgumentRector::class, + + // symfony/form 4.0 + FormIsValidRector::class, + + // symfony/validator 4.0 + ConstraintUrlOptionRector::class, + + // symfony/var-dumper 4.0 + VarDumperTestTraitMethodArgsRector::class, + // symfony/config 4.2 RootNodeTreeBuilderRector::class, @@ -106,39 +200,119 @@ StringToArrayArgumentProcessRector::class, // symfony/event-dispatcher 4.3 - MakeDispatchFirstArgumentEventRector::class, EventDispatcherParentConstructRector::class, + MakeDispatchFirstArgumentEventRector::class, + + // symfony/framework-bundle 4.3 + ConvertRenderTemplateShortNotationToBundleSyntaxRector::class, + + // symfony/intl 4.3 + GetCurrencyBundleMethodCallsToIntlRector::class, - // symfony/console 4.4 and 5.1 + // symfony/twig-bundle 4.3 + TwigBundleFilesystemLoaderToTwigRector::class, + + // symfony/console 4.4 ConsoleExecuteReturnIntRector::class, - CommandConstantReturnCodeRector::class, // symfony/security-core 4.4 AuthorizationCheckerIsGrantedExtractorRector::class, + // symfony/console 5.1 + CommandConstantReturnCodeRector::class, + + // symfony/framework-bundle 5.1 + RouteCollectionBuilderToRoutingConfiguratorRector::class, + // symfony/security-http 5.1 LogoutHandlerToLogoutEventSubscriberRector::class, LogoutSuccessHandlerToLogoutEventSubscriberRector::class, - // symfony/* 5.2 + // symfony/dependency-injection 5.2 DefinitionAliasSetPrivateToSetPublicRector::class, + + // symfony/form 5.2 + FormBuilderSetDataMapperRector::class, + PropertyPathMapperToDataMapperRector::class, + + // symfony/http-foundation 5.2 + BinaryFileResponseCreateToNewInstanceRector::class, + + // symfony/property-access 5.2 + PropertyAccessorCreationBooleanToFlagsRector::class, + + // symfony/property-info 5.2 ReflectionExtractorEnableMagicCallExtractorRector::class, + + // symfony/validator 5.2 ValidatorBuilderEnableAnnotationMappingRector::class, - PropertyAccessorCreationBooleanToFlagsRector::class, - BinaryFileResponseCreateToNewInstanceRector::class, + + // symfony/framework-bundle 5.3 + KernelTestCaseContainerPropertyDeprecationRector::class, + + // symfony/framework-bundle 6.0 + GetHelperControllerToServiceRector::class, + + // symfony/console 6.1 + CommandConfigureToAttributeRector::class, + CommandPropertyToAttributeRector::class, // symfony/validator 6.1 ErrorNamesPropertyToConstantRector::class, - // attributes added in Symfony 6.2 + // symfony/doctrine-bridge 6.2 + ParamConverterAttributeToMapEntityAttributeRector::class, + + // symfony/http-kernel 6.2 + ArgumentValueResolverToValueResolverRector::class, + + // symfony/messenger 6.2 + MessageHandlerInterfaceToAttributeRector::class, + MessageSubscriberInterfaceToAttributeRector::class, + + // symfony/security-http 6.2 SecurityAttributeToIsGrantedAttributeRector::class, SingleConditionSecurityAttributeToIsGrantedRector::class, SplitAndSecurityAttributeToIsGrantedRector::class, - ArgumentValueResolverToValueResolverRector::class, - // symfony/dependency-injection and symfony/console 6.3 - ParamAndEnvAttributeRector::class, + // symfony/console 6.3 SignalableCommandInterfaceReturnTypeRector::class, + + // symfony/dependency-injection 6.3 + ParamAndEnvAttributeRector::class, + + // symfony/http-foundation 7.2 + PushRequestToRequestStackConstructorRector::class, + + // symfony/console 7.3 + CommandDefaultNameAndDescriptionToAsCommandAttributeRector::class, + CommandHelpToAttributeRector::class, + + // symfony/security-core 7.3 + AddVoteArgumentToVoteOnAttributeRector::class, + AuthorizationCheckerToAccessDecisionManagerInVoterRector::class, + + // symfony/validator 7.3 + ConstraintOptionsToNamedArgumentsRector::class, + + // symfony/security-core 8.0 + RemoveEraseCredentialsRector::class, + + // symfony/filesystem 8.1 + RenameCopyOnWindowsOptionToFollowSymlinksRector::class, + + // symfony/security-http 8.1 + RemoveEraseCredentialsFromAuthenticatorManagerRector::class, + + // symfony/uid 8.1 + AddFormatArgumentToIsValidRector::class, + + // symfony/validator 8.1 + ConstraintValidatorValidateToValidateInContextRector::class, + + // twig/twig 3.21 + GetFiltersToAsTwigFilterAttributeRector::class, + GetFunctionsToAsTwigFunctionAttributeRector::class, ]); // shared types used by the configuration below diff --git a/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/MaxLengthSymfonyFormOptionToAttrRectorTest.php b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/MaxLengthSymfonyFormOptionToAttrRectorTest.php index ac571d3b3..dc9985c6f 100644 --- a/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/MaxLengthSymfonyFormOptionToAttrRectorTest.php +++ b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/MaxLengthSymfonyFormOptionToAttrRectorTest.php @@ -28,4 +28,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/composer.json b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/composer.json new file mode 100644 index 000000000..b717a1526 --- /dev/null +++ b/rules-tests/Symfony25/Rector/Array_/MaxLengthSymfonyFormOptionToAttrRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^2.5" + } +} diff --git a/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRectorTest.php b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRectorTest.php index 3cc859a9c..03fee718a 100644 --- a/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRectorTest.php +++ b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/composer.json b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/composer.json new file mode 100644 index 000000000..278d2336b --- /dev/null +++ b/rules-tests/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^2.7" + } +} diff --git a/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php index 19d800430..51ec7cf5c 100644 --- a/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php +++ b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/GetToConstructorInjectionRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/composer.json b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/composer.json new file mode 100644 index 000000000..41033e76d --- /dev/null +++ b/rules-tests/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^2.8" + } +} diff --git a/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/ParseFileRectorTest.php b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/ParseFileRectorTest.php index 981d13d44..c594a830d 100644 --- a/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/ParseFileRectorTest.php +++ b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/ParseFileRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/composer.json b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/composer.json new file mode 100644 index 000000000..0a84e4373 --- /dev/null +++ b/rules-tests/Symfony28/Rector/StaticCall/ParseFileRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/yaml": "^2.8" + } +} diff --git a/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/FormTypeGetParentRectorTest.php b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/FormTypeGetParentRectorTest.php index aa90a9190..54c194f00 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/FormTypeGetParentRectorTest.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/FormTypeGetParentRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/composer.json b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/ClassMethod/FormTypeGetParentRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/GetRequestRectorTest.php b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/GetRequestRectorTest.php index 9333e08cd..8d326252f 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/GetRequestRectorTest.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/GetRequestRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/composer.json b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/composer.json new file mode 100644 index 000000000..0315a92c6 --- /dev/null +++ b/rules-tests/Symfony30/Rector/ClassMethod/GetRequestRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/RemoveDefaultGetBlockPrefixRectorTest.php b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/RemoveDefaultGetBlockPrefixRectorTest.php index 0e8be8e6f..6f5660f69 100644 --- a/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/RemoveDefaultGetBlockPrefixRectorTest.php +++ b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/RemoveDefaultGetBlockPrefixRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/composer.json b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/ChangeStringCollectionOptionToConstantRectorTest.php b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/ChangeStringCollectionOptionToConstantRectorTest.php index 688036a14..bea180494 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/ChangeStringCollectionOptionToConstantRectorTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/ChangeStringCollectionOptionToConstantRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/composer.json b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php index b64667c5f..776c94183 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/FormTypeInstanceToClassConstRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/composer.json b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/composer.json new file mode 100644 index 000000000..0315a92c6 --- /dev/null +++ b/rules-tests/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/OptionNameRectorTest.php b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/OptionNameRectorTest.php index 67f52bb8d..4f8859333 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/OptionNameRectorTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/OptionNameRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/composer.json b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/MethodCall/OptionNameRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php index 78706d856..2cf245cb6 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/ReadOnlyOptionToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/composer.json b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php index 73d3ba589..004893b27 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/StringFormTypeToClassRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/WithContainerTest.php b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/WithContainerTest.php index 15316b416..e15675d1f 100644 --- a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/WithContainerTest.php +++ b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/WithContainerTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/xml_path_config.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/composer.json b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/composer.json new file mode 100644 index 000000000..cc47684c3 --- /dev/null +++ b/rules-tests/Symfony30/Rector/MethodCall/StringFormTypeToClassRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^3.0" + } +} diff --git a/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/ConsoleExceptionToErrorEventConstantRectorTest.php b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/ConsoleExceptionToErrorEventConstantRectorTest.php index f0a76c0cf..e9ee18260 100644 --- a/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/ConsoleExceptionToErrorEventConstantRectorTest.php +++ b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/ConsoleExceptionToErrorEventConstantRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/composer.json b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/composer.json new file mode 100644 index 000000000..a65b34af0 --- /dev/null +++ b/rules-tests/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/console": "^3.3" + } +} diff --git a/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php index bc30e0a67..932d16e3a 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/MergeMethodAnnotationToRouteAnnotationRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/composer.json b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/composer.json new file mode 100644 index 000000000..12dc8ae8c --- /dev/null +++ b/rules-tests/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/routing": "^3.4" + } +} diff --git a/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/RemoveServiceFromSensioRouteRectorTest.php b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/RemoveServiceFromSensioRouteRectorTest.php index acba784c3..b62a15b4d 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/RemoveServiceFromSensioRouteRectorTest.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/RemoveServiceFromSensioRouteRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/composer.json b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/composer.json new file mode 100644 index 000000000..12dc8ae8c --- /dev/null +++ b/rules-tests/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/routing": "^3.4" + } +} diff --git a/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/ReplaceSensioRouteAnnotationWithSymfonyRectorTest.php b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/ReplaceSensioRouteAnnotationWithSymfonyRectorTest.php index 40aa7fd52..bf76db619 100644 --- a/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/ReplaceSensioRouteAnnotationWithSymfonyRectorTest.php +++ b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/ReplaceSensioRouteAnnotationWithSymfonyRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/composer.json b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/composer.json new file mode 100644 index 000000000..12dc8ae8c --- /dev/null +++ b/rules-tests/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/routing": "^3.4" + } +} diff --git a/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/ContainerGetNameToTypeInTestsRectorTest.php b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/ContainerGetNameToTypeInTestsRectorTest.php index 319ada5bb..b0e181f8d 100644 --- a/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/ContainerGetNameToTypeInTestsRectorTest.php +++ b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/ContainerGetNameToTypeInTestsRectorTest.php @@ -28,4 +28,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/composer.json b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/composer.json new file mode 100644 index 000000000..50247092b --- /dev/null +++ b/rules-tests/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/dependency-injection": "^3.4" + } +} diff --git a/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/ConstraintUrlOptionRectorTest.php b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/ConstraintUrlOptionRectorTest.php index 1014985b0..4791c2508 100644 --- a/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/ConstraintUrlOptionRectorTest.php +++ b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/ConstraintUrlOptionRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/composer.json b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/composer.json new file mode 100644 index 000000000..ee67d8080 --- /dev/null +++ b/rules-tests/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/validator": "^4.0" + } +} diff --git a/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/ContainerBuilderCompileEnvArgumentRectorTest.php b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/ContainerBuilderCompileEnvArgumentRectorTest.php index c42cc42c6..d50db2a63 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/ContainerBuilderCompileEnvArgumentRectorTest.php +++ b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/ContainerBuilderCompileEnvArgumentRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/composer.json b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/composer.json new file mode 100644 index 000000000..deefc75f0 --- /dev/null +++ b/rules-tests/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/dependency-injection": "^4.0" + } +} diff --git a/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/FormIsValidRectorTest.php b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/FormIsValidRectorTest.php index 8804f2d56..453051f1c 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/FormIsValidRectorTest.php +++ b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/FormIsValidRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/composer.json b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/composer.json new file mode 100644 index 000000000..558e4c0db --- /dev/null +++ b/rules-tests/Symfony40/Rector/MethodCall/FormIsValidRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^4.0" + } +} diff --git a/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php index 9760acc40..ce3b01b6c 100644 --- a/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php +++ b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/VarDumperTestTraitMethodArgsRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/composer.json b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/composer.json new file mode 100644 index 000000000..0d6c9947f --- /dev/null +++ b/rules-tests/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/var-dumper": "^4.0" + } +} diff --git a/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/ConvertRenderTemplateShortNotationToBundleSyntaxRectorTest.php b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/ConvertRenderTemplateShortNotationToBundleSyntaxRectorTest.php index ce008fe0d..91844e7cc 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/ConvertRenderTemplateShortNotationToBundleSyntaxRectorTest.php +++ b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/ConvertRenderTemplateShortNotationToBundleSyntaxRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/composer.json b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/composer.json new file mode 100644 index 000000000..9ab3e0ceb --- /dev/null +++ b/rules-tests/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^4.3" + } +} diff --git a/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/GetCurrencyBundleMethodCallsToIntlRectorTest.php b/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/GetCurrencyBundleMethodCallsToIntlRectorTest.php index 50b54415f..4854b1e9d 100644 --- a/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/GetCurrencyBundleMethodCallsToIntlRectorTest.php +++ b/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/GetCurrencyBundleMethodCallsToIntlRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/config/composer.json b/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/config/composer.json new file mode 100644 index 000000000..999272763 --- /dev/null +++ b/rules-tests/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/intl": "^4.3" + } +} diff --git a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php index 85b539bec..ed6f30f21 100644 --- a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php +++ b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/TwigBundleFilesystemLoaderToTwigRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/composer.json b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/composer.json new file mode 100644 index 000000000..d94fa091c --- /dev/null +++ b/rules-tests/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/twig-bundle": "^4.3" + } +} diff --git a/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/RouteCollectionBuilderToRoutingConfiguratorRectorTest.php b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/RouteCollectionBuilderToRoutingConfiguratorRectorTest.php index 57cbc95fa..3b7ed6339 100644 --- a/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/RouteCollectionBuilderToRoutingConfiguratorRectorTest.php +++ b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/RouteCollectionBuilderToRoutingConfiguratorRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/composer.json b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/composer.json new file mode 100644 index 000000000..16037dc1d --- /dev/null +++ b/rules-tests/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^5.1" + } +} diff --git a/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/FormBuilderSetDataMapperRectorTest.php b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/FormBuilderSetDataMapperRectorTest.php index 71747b012..b405eb264 100644 --- a/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/FormBuilderSetDataMapperRectorTest.php +++ b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/FormBuilderSetDataMapperRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/composer.json b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/composer.json new file mode 100644 index 000000000..9101cfc4c --- /dev/null +++ b/rules-tests/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^5.2" + } +} diff --git a/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/PropertyPathMapperToDataMapperRectorTest.php b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/PropertyPathMapperToDataMapperRectorTest.php index 2c96b72e4..5009ee86b 100644 --- a/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/PropertyPathMapperToDataMapperRectorTest.php +++ b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/PropertyPathMapperToDataMapperRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/composer.json b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/composer.json new file mode 100644 index 000000000..9101cfc4c --- /dev/null +++ b/rules-tests/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/form": "^5.2" + } +} diff --git a/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/KernelTestCaseContainerPropertyDeprecationRectorTest.php b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/KernelTestCaseContainerPropertyDeprecationRectorTest.php index 0b4b3e334..217da066f 100644 --- a/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/KernelTestCaseContainerPropertyDeprecationRectorTest.php +++ b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/KernelTestCaseContainerPropertyDeprecationRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/composer.json b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/composer.json new file mode 100644 index 000000000..c45e5f499 --- /dev/null +++ b/rules-tests/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^5.3" + } +} diff --git a/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/GetHelperControllerToServiceRectorTest.php b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/GetHelperControllerToServiceRectorTest.php index 3f8a1a52f..0f14bd745 100644 --- a/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/GetHelperControllerToServiceRectorTest.php +++ b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/GetHelperControllerToServiceRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/composer.json b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/composer.json new file mode 100644 index 000000000..9bd3810c5 --- /dev/null +++ b/rules-tests/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/framework-bundle": "^6.0" + } +} diff --git a/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/CommandConfigureToAttributeRectorTest.php b/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/CommandConfigureToAttributeRectorTest.php index 81eb9c5b3..ac6fe8ccb 100644 --- a/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/CommandConfigureToAttributeRectorTest.php +++ b/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/CommandConfigureToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/config/composer.json b/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/config/composer.json new file mode 100644 index 000000000..a52ac3352 --- /dev/null +++ b/rules-tests/Symfony61/Rector/Class_/CommandConfigureToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/console": "^6.1" + } +} diff --git a/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/CommandPropertyToAttributeRectorTest.php b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/CommandPropertyToAttributeRectorTest.php index 64f5a5bd7..cd5f581fa 100644 --- a/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/CommandPropertyToAttributeRectorTest.php +++ b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/CommandPropertyToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/composer.json b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/composer.json new file mode 100644 index 000000000..a52ac3352 --- /dev/null +++ b/rules-tests/Symfony61/Rector/Class_/CommandPropertyToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/console": "^6.1" + } +} diff --git a/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/ParamConverterAttributeToMapEntityAttributeRectorTest.php b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/ParamConverterAttributeToMapEntityAttributeRectorTest.php index ea7a675ad..b51c570fa 100644 --- a/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/ParamConverterAttributeToMapEntityAttributeRectorTest.php +++ b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/ParamConverterAttributeToMapEntityAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/composer.json b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/composer.json new file mode 100644 index 000000000..bbb351946 --- /dev/null +++ b/rules-tests/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/doctrine-bridge": "^6.2" + } +} diff --git a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/MessageHandlerToAttributeRectorTest.php b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/MessageHandlerToAttributeRectorTest.php index e03ee618d..55787b083 100644 --- a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/MessageHandlerToAttributeRectorTest.php +++ b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/MessageHandlerToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/config/composer.json b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/config/composer.json new file mode 100644 index 000000000..b71980de7 --- /dev/null +++ b/rules-tests/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/messenger": "^6.2" + } +} diff --git a/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/MessageSubscriberInterfaceToAttributeRectorTest.php b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/MessageSubscriberInterfaceToAttributeRectorTest.php index 80e1b4b49..0e26efdca 100644 --- a/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/MessageSubscriberInterfaceToAttributeRectorTest.php +++ b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/MessageSubscriberInterfaceToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/composer.json b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/composer.json new file mode 100644 index 000000000..b71980de7 --- /dev/null +++ b/rules-tests/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/messenger": "^6.2" + } +} diff --git a/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/PushRequestToRequestStackConstructorRectorTest.php b/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/PushRequestToRequestStackConstructorRectorTest.php index 57258e751..1b8c95d3b 100644 --- a/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/PushRequestToRequestStackConstructorRectorTest.php +++ b/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/PushRequestToRequestStackConstructorRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/config/composer.json b/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/config/composer.json new file mode 100644 index 000000000..6df61c5fd --- /dev/null +++ b/rules-tests/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/http-foundation": "^7.2" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/AddVoteArgumentToVoteOnAttributeRectorTest.php b/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/AddVoteArgumentToVoteOnAttributeRectorTest.php index e42ff44c6..10453cf73 100644 --- a/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/AddVoteArgumentToVoteOnAttributeRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/AddVoteArgumentToVoteOnAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/config/composer.json new file mode 100644 index 000000000..2a78ae350 --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/security-core": "^7.3" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/AuthorizationCheckerToAccessDecisionManagerInVoterRectorTest.php b/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/AuthorizationCheckerToAccessDecisionManagerInVoterRectorTest.php index 0e2503e46..84a3febb9 100644 --- a/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/AuthorizationCheckerToAccessDecisionManagerInVoterRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/AuthorizationCheckerToAccessDecisionManagerInVoterRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/config/composer.json new file mode 100644 index 000000000..2a78ae350 --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/security-core": "^7.3" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/CommandDefaultNameAndDescriptionToAsCommandAttributeRectorTest.php b/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/CommandDefaultNameAndDescriptionToAsCommandAttributeRectorTest.php index 9e41e3ddb..15d865bf5 100644 --- a/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/CommandDefaultNameAndDescriptionToAsCommandAttributeRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/CommandDefaultNameAndDescriptionToAsCommandAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/config/composer.json new file mode 100644 index 000000000..dd0c61edf --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/console": "^7.3" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/CommandHelpToAttributeRectorTest.php b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/CommandHelpToAttributeRectorTest.php index 415f405fb..965868f45 100644 --- a/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/CommandHelpToAttributeRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/CommandHelpToAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/config/composer.json new file mode 100644 index 000000000..dd0c61edf --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/CommandHelpToAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/console": "^7.3" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/ConstraintOptionsToNamedArgumentsRectorTest.php b/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/ConstraintOptionsToNamedArgumentsRectorTest.php index c1f806142..56053afff 100644 --- a/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/ConstraintOptionsToNamedArgumentsRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/ConstraintOptionsToNamedArgumentsRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/config/composer.json new file mode 100644 index 000000000..a18ba20f9 --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/validator": "^7.3" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/GetFiltersToAsTwigFilterAttributeRectorTest.php b/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/GetFiltersToAsTwigFilterAttributeRectorTest.php index bab0f7698..1e73ae52c 100644 --- a/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/GetFiltersToAsTwigFilterAttributeRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/GetFiltersToAsTwigFilterAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/config/composer.json new file mode 100644 index 000000000..26b1296fe --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "twig/twig": "^3.21" + } +} diff --git a/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/GetFunctionsToAsTwigFunctionAttributeRectorTest.php b/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/GetFunctionsToAsTwigFunctionAttributeRectorTest.php index 865f69d4c..72cc523fe 100644 --- a/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/GetFunctionsToAsTwigFunctionAttributeRectorTest.php +++ b/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/GetFunctionsToAsTwigFunctionAttributeRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/config/composer.json b/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/config/composer.json new file mode 100644 index 000000000..26b1296fe --- /dev/null +++ b/rules-tests/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "twig/twig": "^3.21" + } +} diff --git a/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/RemoveEraseCredentialsRectorTest.php b/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/RemoveEraseCredentialsRectorTest.php index 7ea73ebae..1ce6bee04 100644 --- a/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/RemoveEraseCredentialsRectorTest.php +++ b/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/RemoveEraseCredentialsRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/config/composer.json b/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/config/composer.json new file mode 100644 index 000000000..5ed0c7a52 --- /dev/null +++ b/rules-tests/Symfony80/Rector/Class_/RemoveEraseCredentialsRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/security-core": "^8.0" + } +} diff --git a/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/ConstraintValidatorValidateToValidateInContextRectorTest.php b/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/ConstraintValidatorValidateToValidateInContextRectorTest.php index c7f1627c0..53094cc37 100644 --- a/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/ConstraintValidatorValidateToValidateInContextRectorTest.php +++ b/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/ConstraintValidatorValidateToValidateInContextRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/config/composer.json b/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/config/composer.json new file mode 100644 index 000000000..50c423926 --- /dev/null +++ b/rules-tests/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/validator": "^8.1" + } +} diff --git a/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/RenameCopyOnWindowsOptionToFollowSymlinksRectorTest.php b/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/RenameCopyOnWindowsOptionToFollowSymlinksRectorTest.php index c77cf1ec1..d428acc8c 100644 --- a/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/RenameCopyOnWindowsOptionToFollowSymlinksRectorTest.php +++ b/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/RenameCopyOnWindowsOptionToFollowSymlinksRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/config/composer.json b/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/config/composer.json new file mode 100644 index 000000000..71a94eade --- /dev/null +++ b/rules-tests/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/filesystem": "^8.1" + } +} diff --git a/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/RemoveEraseCredentialsFromAuthenticatorManagerRectorTest.php b/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/RemoveEraseCredentialsFromAuthenticatorManagerRectorTest.php index 2ceeea863..f3651f86c 100644 --- a/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/RemoveEraseCredentialsFromAuthenticatorManagerRectorTest.php +++ b/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/RemoveEraseCredentialsFromAuthenticatorManagerRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/config/composer.json b/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/config/composer.json new file mode 100644 index 000000000..4362088eb --- /dev/null +++ b/rules-tests/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/security-http": "^8.1" + } +} diff --git a/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/AddFormatArgumentToIsValidRectorTest.php b/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/AddFormatArgumentToIsValidRectorTest.php index 6f44c7425..d45904076 100644 --- a/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/AddFormatArgumentToIsValidRectorTest.php +++ b/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/AddFormatArgumentToIsValidRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/config/composer.json b/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/config/composer.json new file mode 100644 index 000000000..557322ffc --- /dev/null +++ b/rules-tests/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/uid": "^8.1" + } +} diff --git a/rules/Symfony25/Rector/MethodCall/MaxLengthSymfonyFormOptionToAttrRector.php b/rules/Symfony25/Rector/MethodCall/MaxLengthSymfonyFormOptionToAttrRector.php index 725f6b9cb..21b6acd52 100644 --- a/rules/Symfony25/Rector/MethodCall/MaxLengthSymfonyFormOptionToAttrRector.php +++ b/rules/Symfony25/Rector/MethodCall/MaxLengthSymfonyFormOptionToAttrRector.php @@ -14,6 +14,8 @@ use Rector\Exception\ShouldNotHappenException; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -24,13 +26,18 @@ * * @see \Rector\Symfony\Tests\Symfony25\Rector\Array_\MaxLengthSymfonyFormOptionToAttrRector\MaxLengthSymfonyFormOptionToAttrRectorTest */ -final class MaxLengthSymfonyFormOptionToAttrRector extends AbstractRector +final class MaxLengthSymfonyFormOptionToAttrRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ValueResolver $valueResolver ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=2.5'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Change form option "max_length" to a form "attr" > "max_length"', [ diff --git a/rules/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector.php b/rules/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector.php index bd24ec6ce..4fa2a3810 100644 --- a/rules/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector.php +++ b/rules/Symfony27/Rector/MethodCall/ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector.php @@ -15,6 +15,8 @@ use Rector\Symfony\NodeAnalyzer\FormAddMethodCallAnalyzer; use Rector\Symfony\NodeAnalyzer\FormCollectionAnalyzer; use Rector\Symfony\NodeAnalyzer\FormOptionsArrayMatcher; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -23,7 +25,7 @@ * * @see \Rector\Symfony\Tests\Symfony27\Rector\MethodCall\ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector\ChangeCollectionTypeOptionNameFromTypeToEntryTypeRectorTest */ -final class ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector extends AbstractRector +final class ChangeCollectionTypeOptionNameFromTypeToEntryTypeRector extends AbstractRector implements ComposerPackageConstraintInterface { /** * @var array @@ -41,6 +43,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=2.7'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector.php b/rules/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector.php index 7393973e0..08455e728 100644 --- a/rules/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector.php +++ b/rules/Symfony28/Rector/MethodCall/GetToConstructorInjectionRector.php @@ -12,13 +12,15 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\NodeAnalyzer\DependencyInjectionMethodCallAnalyzer; use Rector\Symfony\TypeAnalyzer\ContainerAwareAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector\GetToConstructorInjectionRectorTest */ -final class GetToConstructorInjectionRector extends AbstractRector +final class GetToConstructorInjectionRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly DependencyInjectionMethodCallAnalyzer $dependencyInjectionMethodCallAnalyzer, @@ -27,6 +29,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=2.8'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony28/Rector/StaticCall/ParseFileRector.php b/rules/Symfony28/Rector/StaticCall/ParseFileRector.php index 1b4b2a262..9ec23c771 100644 --- a/rules/Symfony28/Rector/StaticCall/ParseFileRector.php +++ b/rules/Symfony28/Rector/StaticCall/ParseFileRector.php @@ -15,13 +15,15 @@ use Rector\PhpParser\Printer\BetterStandardPrinter; use Rector\Rector\AbstractRector; use Rector\Util\StringUtils; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony28\Rector\StaticCall\ParseFileRector\ParseFileRectorTest */ -final class ParseFileRector extends AbstractRector +final class ParseFileRector extends AbstractRector implements ComposerPackageConstraintInterface { /** * @changelog https://regex101.com/r/ZaY42i/1 @@ -43,6 +45,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/yaml', '>=2.8'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Replaces deprecated Yaml::parse() of file argument with file contents', [ diff --git a/rules/Symfony30/Rector/ClassMethod/FormTypeGetParentRector.php b/rules/Symfony30/Rector/ClassMethod/FormTypeGetParentRector.php index 41c3fb75c..5ab487b64 100644 --- a/rules/Symfony30/Rector/ClassMethod/FormTypeGetParentRector.php +++ b/rules/Symfony30/Rector/ClassMethod/FormTypeGetParentRector.php @@ -14,19 +14,26 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; use Rector\Symfony\FormHelper\FormTypeStringToTypeProvider; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony30\Rector\ClassMethod\FormTypeGetParentRector\FormTypeGetParentRectorTest */ -final class FormTypeGetParentRector extends AbstractRector +final class FormTypeGetParentRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly FormTypeStringToTypeProvider $formTypeStringToTypeProvider, ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/ClassMethod/GetRequestRector.php b/rules/Symfony30/Rector/ClassMethod/GetRequestRector.php index e70beae64..465673d69 100644 --- a/rules/Symfony30/Rector/ClassMethod/GetRequestRector.php +++ b/rules/Symfony30/Rector/ClassMethod/GetRequestRector.php @@ -21,13 +21,15 @@ use Rector\Symfony\Enum\SymfonyAnnotation; use Rector\Symfony\Enum\SymfonyClass; use Rector\Symfony\TypeAnalyzer\ControllerAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony30\Rector\ClassMethod\GetRequestRector\GetRequestRectorTest */ -final class GetRequestRector extends AbstractRector +final class GetRequestRector extends AbstractRector implements ComposerPackageConstraintInterface { private ?string $requestVariableAndParamName = null; @@ -38,6 +40,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector.php b/rules/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector.php index fa8748dc5..64052566a 100644 --- a/rules/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector.php +++ b/rules/Symfony30/Rector/ClassMethod/RemoveDefaultGetBlockPrefixRector.php @@ -14,6 +14,8 @@ use Rector\CodingStyle\Naming\ClassNaming; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -22,7 +24,7 @@ * * @see \Rector\Symfony\Tests\Symfony30\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector\RemoveDefaultGetBlockPrefixRectorTest */ -final class RemoveDefaultGetBlockPrefixRector extends AbstractRector +final class RemoveDefaultGetBlockPrefixRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ValueResolver $valueResolver, @@ -30,6 +32,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector.php b/rules/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector.php index 82cb77ddd..25cbbb3d7 100644 --- a/rules/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector.php +++ b/rules/Symfony30/Rector/MethodCall/ChangeStringCollectionOptionToConstantRector.php @@ -16,6 +16,8 @@ use Rector\Symfony\NodeAnalyzer\FormAddMethodCallAnalyzer; use Rector\Symfony\NodeAnalyzer\FormCollectionAnalyzer; use Rector\Symfony\NodeAnalyzer\FormOptionsArrayMatcher; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -26,7 +28,7 @@ * * @see \Rector\Symfony\Tests\Symfony30\Rector\MethodCall\ChangeStringCollectionOptionToConstantRector\ChangeStringCollectionOptionToConstantRectorTest */ -final class ChangeStringCollectionOptionToConstantRector extends AbstractRector +final class ChangeStringCollectionOptionToConstantRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly FormAddMethodCallAnalyzer $formAddMethodCallAnalyzer, @@ -37,6 +39,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector.php b/rules/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector.php index 02b29ff12..0ed2a869c 100644 --- a/rules/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector.php +++ b/rules/Symfony30/Rector/MethodCall/FormTypeInstanceToClassConstRector.php @@ -18,6 +18,8 @@ use Rector\Symfony\NodeAnalyzer\FormInstanceToFormClassConstFetchConverter; use Rector\Symfony\NodeAnalyzer\FormOptionsArrayMatcher; use Rector\Symfony\TypeAnalyzer\ControllerAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -32,7 +34,7 @@ * * @see \Rector\Symfony\Tests\Symfony30\Rector\MethodCall\FormTypeInstanceToClassConstRector\FormTypeInstanceToClassConstRectorTest */ -final class FormTypeInstanceToClassConstRector extends AbstractRector +final class FormTypeInstanceToClassConstRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly FormInstanceToFormClassConstFetchConverter $formInstanceToFormClassConstFetchConverter, @@ -44,6 +46,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/MethodCall/OptionNameRector.php b/rules/Symfony30/Rector/MethodCall/OptionNameRector.php index 3ffadaf7a..62449f407 100644 --- a/rules/Symfony30/Rector/MethodCall/OptionNameRector.php +++ b/rules/Symfony30/Rector/MethodCall/OptionNameRector.php @@ -12,13 +12,15 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\NodeAnalyzer\FormAddMethodCallAnalyzer; use Rector\Symfony\NodeAnalyzer\FormOptionsArrayMatcher; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony30\Rector\MethodCall\OptionNameRector\OptionNameRectorTest */ -final class OptionNameRector extends AbstractRector +final class OptionNameRector extends AbstractRector implements ComposerPackageConstraintInterface { /** * @var array @@ -34,6 +36,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector.php b/rules/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector.php index ba511e529..d87433c0c 100644 --- a/rules/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector.php +++ b/rules/Symfony30/Rector/MethodCall/ReadOnlyOptionToAttributeRector.php @@ -13,13 +13,15 @@ use Rector\Symfony\NodeAnalyzer\FormAddMethodCallAnalyzer; use Rector\Symfony\NodeAnalyzer\FormOptionsArrayMatcher; use Rector\Symfony\NodeManipulator\ArrayManipulator; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony30\Rector\MethodCall\ReadOnlyOptionToAttributeRector\ReadOnlyOptionToAttributeRectorTest */ -final class ReadOnlyOptionToAttributeRector extends AbstractRector +final class ReadOnlyOptionToAttributeRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ArrayManipulator $arrayManipulator, @@ -28,6 +30,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony30/Rector/MethodCall/StringFormTypeToClassRector.php b/rules/Symfony30/Rector/MethodCall/StringFormTypeToClassRector.php index 98987db42..6a35a643f 100644 --- a/rules/Symfony30/Rector/MethodCall/StringFormTypeToClassRector.php +++ b/rules/Symfony30/Rector/MethodCall/StringFormTypeToClassRector.php @@ -11,6 +11,8 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\FormHelper\FormTypeStringToTypeProvider; use Rector\Symfony\NodeAnalyzer\FormAddMethodCallAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -19,7 +21,7 @@ * * @see \Rector\Symfony\Tests\Symfony30\Rector\MethodCall\StringFormTypeToClassRector\StringFormTypeToClassRectorTest */ -final class StringFormTypeToClassRector extends AbstractRector +final class StringFormTypeToClassRector extends AbstractRector implements ComposerPackageConstraintInterface { private const string DESCRIPTION = 'Turns string Form Type references to their CONSTANT alternatives in FormTypes in Form in Symfony. To enable custom types, add link to your container XML dump in "$rectorConfig->symfonyContainerXml(...)"'; @@ -29,6 +31,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=3.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition(self::DESCRIPTION, [ diff --git a/rules/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php b/rules/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php index 62b597b5a..198f97e09 100644 --- a/rules/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php +++ b/rules/Symfony33/Rector/ClassConstFetch/ConsoleExceptionToErrorEventConstantRector.php @@ -9,6 +9,8 @@ use PhpParser\Node\Scalar\String_; use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symfony\Component\Console\ConsoleEvents; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -20,7 +22,7 @@ * * @see \Rector\Symfony\Tests\Symfony33\Rector\ClassConstFetch\ConsoleExceptionToErrorEventConstantRector\ConsoleExceptionToErrorEventConstantRectorTest */ -final class ConsoleExceptionToErrorEventConstantRector extends AbstractRector +final class ConsoleExceptionToErrorEventConstantRector extends AbstractRector implements ComposerPackageConstraintInterface { private readonly ObjectType $consoleEventsObjectType; @@ -29,6 +31,11 @@ public function __construct() $this->consoleEventsObjectType = new ObjectType('Symfony\Component\Console\ConsoleEvents'); } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/console', '>=3.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector.php b/rules/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector.php index 172075b7f..6ddeecc8c 100644 --- a/rules/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector.php +++ b/rules/Symfony34/Rector/ClassMethod/MergeMethodAnnotationToRouteAnnotationRector.php @@ -16,6 +16,8 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SensioAttribute; use Rector\Symfony\Enum\SymfonyAnnotation; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -25,7 +27,7 @@ * * @see \Rector\Symfony\Tests\Symfony34\Rector\ClassMethod\MergeMethodAnnotationToRouteAnnotationRector\MergeMethodAnnotationToRouteAnnotationRectorTest */ -final class MergeMethodAnnotationToRouteAnnotationRector extends AbstractRector +final class MergeMethodAnnotationToRouteAnnotationRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly PhpDocTagRemover $phpDocTagRemover, @@ -34,6 +36,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/routing', '>=3.4'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector.php b/rules/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector.php index ecb665a1a..acdcf377e 100644 --- a/rules/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector.php +++ b/rules/Symfony34/Rector/ClassMethod/RemoveServiceFromSensioRouteRector.php @@ -13,13 +13,15 @@ use Rector\Comments\NodeDocBlock\DocBlockUpdater; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SensioAnnotation; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony34\Rector\ClassMethod\RemoveServiceFromSensioRouteRector\RemoveServiceFromSensioRouteRectorTest */ -final class RemoveServiceFromSensioRouteRector extends AbstractRector +final class RemoveServiceFromSensioRouteRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly DocBlockUpdater $docBlockUpdater, @@ -27,6 +29,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/routing', '>=3.4'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Remove service from Sensio @Route', [ diff --git a/rules/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php b/rules/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php index 413ab7a99..48c8df960 100644 --- a/rules/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php +++ b/rules/Symfony34/Rector/ClassMethod/ReplaceSensioRouteAnnotationWithSymfonyRector.php @@ -18,6 +18,8 @@ use Rector\Symfony\Enum\SensioAnnotation; use Rector\Symfony\Enum\SymfonyAnnotation; use Rector\Symfony\PhpDocNode\SymfonyRouteTagValueNodeFactory; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -27,7 +29,7 @@ * * @see \Rector\Symfony\Tests\Symfony34\Rector\ClassMethod\ReplaceSensioRouteAnnotationWithSymfonyRector\ReplaceSensioRouteAnnotationWithSymfonyRectorTest */ -final class ReplaceSensioRouteAnnotationWithSymfonyRector extends AbstractRector +final class ReplaceSensioRouteAnnotationWithSymfonyRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly SymfonyRouteTagValueNodeFactory $symfonyRouteTagValueNodeFactory, @@ -38,6 +40,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/routing', '>=3.4'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector.php b/rules/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector.php index 3b304436d..60cf84e92 100644 --- a/rules/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector.php +++ b/rules/Symfony34/Rector/Closure/ContainerGetNameToTypeInTestsRector.php @@ -14,13 +14,15 @@ use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; use Rector\Rector\AbstractRector; use Rector\Symfony\NodeAnalyzer\ServiceTypeMethodCallResolver; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector\ContainerGetNameToTypeInTestsRectorTest */ -final class ContainerGetNameToTypeInTestsRector extends AbstractRector +final class ContainerGetNameToTypeInTestsRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly TestsNodeAnalyzer $testsNodeAnalyzer, @@ -28,6 +30,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/dependency-injection', '>=3.4'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector.php b/rules/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector.php index 47efd84fc..548cf29c4 100644 --- a/rules/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector.php +++ b/rules/Symfony40/Rector/ConstFetch/ConstraintUrlOptionRector.php @@ -12,6 +12,8 @@ use PHPStan\Type\ObjectType; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -20,7 +22,7 @@ * * @see \Rector\Symfony\Tests\Symfony40\Rector\ConstFetch\ConstraintUrlOptionRector\ConstraintUrlOptionRectorTest */ -final class ConstraintUrlOptionRector extends AbstractRector +final class ConstraintUrlOptionRector extends AbstractRector implements ComposerPackageConstraintInterface { private const string URL_CONSTRAINT_CLASS = 'Symfony\Component\Validator\Constraints\Url'; @@ -29,6 +31,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/validator', '>=4.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector.php b/rules/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector.php index f4631bdd1..356e7e6fe 100644 --- a/rules/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector.php +++ b/rules/Symfony40/Rector/MethodCall/ContainerBuilderCompileEnvArgumentRector.php @@ -8,14 +8,21 @@ use PhpParser\Node\Expr\MethodCall; use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony40\Rector\MethodCall\ContainerBuilderCompileEnvArgumentRector\ContainerBuilderCompileEnvArgumentRectorTest */ -final class ContainerBuilderCompileEnvArgumentRector extends AbstractRector +final class ContainerBuilderCompileEnvArgumentRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/dependency-injection', '>=4.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony40/Rector/MethodCall/FormIsValidRector.php b/rules/Symfony40/Rector/MethodCall/FormIsValidRector.php index d676e2b18..fe0db6256 100644 --- a/rules/Symfony40/Rector/MethodCall/FormIsValidRector.php +++ b/rules/Symfony40/Rector/MethodCall/FormIsValidRector.php @@ -12,14 +12,21 @@ use PHPStan\Type\ObjectType; use Rector\PhpParser\NodeTraverser\SimpleNodeTraverser; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony40\Rector\MethodCall\FormIsValidRector\FormIsValidRectorTest */ -final class FormIsValidRector extends AbstractRector +final class FormIsValidRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=4.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector.php b/rules/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector.php index c6cdcb269..611cfa409 100644 --- a/rules/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector.php +++ b/rules/Symfony40/Rector/MethodCall/VarDumperTestTraitMethodArgsRector.php @@ -11,14 +11,21 @@ use PhpParser\Node\Scalar\String_; use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony40\Rector\MethodCall\VarDumperTestTraitMethodArgsRector\VarDumperTestTraitMethodArgsRectorTest */ -final class VarDumperTestTraitMethodArgsRector extends AbstractRector +final class VarDumperTestTraitMethodArgsRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/var-dumper', '>=4.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php b/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php index e64b6145e..bcb26ac95 100644 --- a/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php +++ b/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php @@ -14,6 +14,8 @@ use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -25,13 +27,18 @@ * * @see \Rector\Symfony\Tests\Symfony43\Rector\MethodCall\ConvertRenderTemplateShortNotationToBundleSyntaxRector\ConvertRenderTemplateShortNotationToBundleSyntaxRectorTest */ -final class ConvertRenderTemplateShortNotationToBundleSyntaxRector extends AbstractRector +final class ConvertRenderTemplateShortNotationToBundleSyntaxRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ValueResolver $valueResolver ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=4.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector.php b/rules/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector.php index 212bc7ff0..aaaf5541c 100644 --- a/rules/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector.php +++ b/rules/Symfony43/Rector/MethodCall/GetCurrencyBundleMethodCallsToIntlRector.php @@ -11,6 +11,8 @@ use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; use Rector\Symfony\ValueObject\IntlBundleClassToNewClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -20,7 +22,7 @@ * * @see \Rector\Symfony\Tests\Symfony43\Rector\MethodCall\GetCurrencyBundleMethodCallsToIntlRector\GetCurrencyBundleMethodCallsToIntlRectorTest */ -final class GetCurrencyBundleMethodCallsToIntlRector extends AbstractRector +final class GetCurrencyBundleMethodCallsToIntlRector extends AbstractRector implements ComposerPackageConstraintInterface { /** * @var IntlBundleClassToNewClass[] @@ -59,6 +61,11 @@ public function __construct() ); } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/intl', '>=4.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Intl static bundle method were changed to direct static calls', [ diff --git a/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php b/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php index c20cedf7d..a8033eccf 100644 --- a/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php +++ b/rules/Symfony43/Rector/StmtsAwareInterface/TwigBundleFilesystemLoaderToTwigRector.php @@ -14,14 +14,21 @@ use PHPStan\Type\ObjectType; use Rector\PhpParser\Enum\NodeGroup; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony43\Rector\StmtsAwareInterface\TwigBundleFilesystemLoaderToTwigRector\TwigBundleFilesystemLoaderToTwigRectorTest */ -final class TwigBundleFilesystemLoaderToTwigRector extends AbstractRector +final class TwigBundleFilesystemLoaderToTwigRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/twig-bundle', '>=4.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Change TwigBundle FilesystemLoader to native one', [ diff --git a/rules/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector.php b/rules/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector.php index 07c5fe1b4..a0a42aa81 100644 --- a/rules/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector.php +++ b/rules/Symfony51/Rector/ClassMethod/RouteCollectionBuilderToRoutingConfiguratorRector.php @@ -14,6 +14,8 @@ use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -22,8 +24,13 @@ * * @see \Rector\Symfony\Tests\Symfony51\Rector\ClassMethod\RouteCollectionBuilderToRoutingConfiguratorRector\RouteCollectionBuilderToRoutingConfiguratorRectorTest */ -final class RouteCollectionBuilderToRoutingConfiguratorRector extends AbstractRector +final class RouteCollectionBuilderToRoutingConfiguratorRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=5.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Change RouteCollectionBuilder to RoutingConfiguratorRector', [ diff --git a/rules/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector.php b/rules/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector.php index 7e2c32721..daa8968cf 100644 --- a/rules/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector.php +++ b/rules/Symfony52/Rector/MethodCall/FormBuilderSetDataMapperRector.php @@ -11,6 +11,8 @@ use PhpParser\Node\Name\FullyQualified; use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -18,7 +20,7 @@ * @changelog https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#form * @see \Rector\Symfony\Tests\Symfony52\Rector\MethodCall\FormBuilderSetDataMapperRector\FormBuilderSetDataMapperRectorTest */ -final class FormBuilderSetDataMapperRector extends AbstractRector +final class FormBuilderSetDataMapperRector extends AbstractRector implements ComposerPackageConstraintInterface { private const string DATAMAPPER_INTERFACE = 'Symfony\Component\Form\DataMapperInterface'; @@ -34,6 +36,11 @@ public function __construct() $this->dataMapperObjectType = new ObjectType(self::DATAMAPPER_CLASS); } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=5.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector.php b/rules/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector.php index c2e93b13d..a2962b8e0 100644 --- a/rules/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector.php +++ b/rules/Symfony52/Rector/New_/PropertyPathMapperToDataMapperRector.php @@ -9,6 +9,8 @@ use PhpParser\Node\Name; use PhpParser\Node\Name\FullyQualified; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -16,8 +18,13 @@ * @changelog https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#form * @see \Rector\Symfony\Tests\Symfony52\Rector\New_\PropertyPathMapperToDataMapperRector\PropertyPathMapperToDataMapperRectorTest */ -final class PropertyPathMapperToDataMapperRector extends AbstractRector +final class PropertyPathMapperToDataMapperRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/form', '>=5.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Migrate from PropertyPathMapper to DataMapper and PropertyPathAccessor', [ diff --git a/rules/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector.php b/rules/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector.php index 1b0cd07bf..ce7eeb7a4 100644 --- a/rules/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector.php +++ b/rules/Symfony53/Rector/StaticPropertyFetch/KernelTestCaseContainerPropertyDeprecationRector.php @@ -9,19 +9,26 @@ use PhpParser\Node\Name; use Rector\Rector\AbstractRector; use Rector\Symfony\NodeAnalyzer\SymfonyTestCaseAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector\KernelTestCaseContainerPropertyDeprecationRectorTest */ -final class KernelTestCaseContainerPropertyDeprecationRector extends AbstractRector +final class KernelTestCaseContainerPropertyDeprecationRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly SymfonyTestCaseAnalyzer $symfonyTestCaseAnalyzer, ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=5.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Simplify use of assertions in WebTestCase', [ diff --git a/rules/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector.php b/rules/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector.php index 2744429dc..6bd22d4a7 100644 --- a/rules/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector.php +++ b/rules/Symfony60/Rector/MethodCall/GetHelperControllerToServiceRector.php @@ -16,6 +16,8 @@ use Rector\PostRector\ValueObject\PropertyMetadata; use Rector\Rector\AbstractRector; use Rector\Symfony\TypeAnalyzer\ControllerAnalyzer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -25,7 +27,7 @@ * * @see \Rector\Symfony\Tests\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector\GetHelperControllerToServiceRectorTest */ -final class GetHelperControllerToServiceRector extends AbstractRector +final class GetHelperControllerToServiceRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ControllerAnalyzer $controllerAnalyzer, @@ -34,6 +36,11 @@ public function __construct( ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/framework-bundle', '>=6.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony61/Rector/Class_/CommandConfigureToAttributeRector.php b/rules/Symfony61/Rector/Class_/CommandConfigureToAttributeRector.php index 155bba6c0..9b08503a0 100644 --- a/rules/Symfony61/Rector/Class_/CommandConfigureToAttributeRector.php +++ b/rules/Symfony61/Rector/Class_/CommandConfigureToAttributeRector.php @@ -24,7 +24,9 @@ use Rector\Symfony\Enum\SymfonyAttribute; use Rector\Symfony\Enum\SymfonyClass; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use Webmozart\Assert\Assert; @@ -34,7 +36,7 @@ * * @see \Rector\Symfony\Tests\Symfony61\Rector\Class_\CommandConfigureToAttributeRector\CommandConfigureToAttributeRectorTest */ -final class CommandConfigureToAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class CommandConfigureToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { /** * @var array @@ -57,6 +59,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/console', '>=6.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony61/Rector/Class_/CommandPropertyToAttributeRector.php b/rules/Symfony61/Rector/Class_/CommandPropertyToAttributeRector.php index 879fcd572..b2f65f75b 100644 --- a/rules/Symfony61/Rector/Class_/CommandPropertyToAttributeRector.php +++ b/rules/Symfony61/Rector/Class_/CommandPropertyToAttributeRector.php @@ -20,7 +20,9 @@ use Rector\Symfony\Enum\SymfonyAttribute; use Rector\Symfony\Enum\SymfonyClass; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use Webmozart\Assert\Assert; @@ -30,7 +32,7 @@ * * @see \Rector\Symfony\Tests\Symfony61\Rector\Class_\CommandPropertyToAttributeRector\CommandPropertyToAttributeRectorTest */ -final class CommandPropertyToAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class CommandPropertyToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { public function __construct( private readonly PhpAttributeGroupFactory $phpAttributeGroupFactory, @@ -44,6 +46,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/console', '>=6.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector.php b/rules/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector.php index c294985fb..26cb0d45a 100644 --- a/rules/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector.php +++ b/rules/Symfony62/Rector/ClassMethod/ParamConverterAttributeToMapEntityAttributeRector.php @@ -20,7 +20,9 @@ use Rector\Symfony\Enum\SensioAttribute; use Rector\Symfony\Enum\SymfonyAnnotation; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -29,13 +31,18 @@ * * @see \Rector\Symfony\Tests\Symfony62\Rector\ClassMethod\ParamConverterAttributeToMapEntityAttributeRector\ParamConverterAttributeToMapEntityAttributeRectorTest */ -final class ParamConverterAttributeToMapEntityAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class ParamConverterAttributeToMapEntityAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { public function provideMinPhpVersion(): int { return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/doctrine-bridge', '>=6.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector.php b/rules/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector.php index 7fc46d93a..74ba56b3c 100644 --- a/rules/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector.php +++ b/rules/Symfony62/Rector/Class_/MessageHandlerInterfaceToAttributeRector.php @@ -14,14 +14,16 @@ use Rector\Symfony\NodeManipulator\ClassManipulator; use Rector\Symfony\ValueObject\ServiceDefinition; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector\MessageHandlerToAttributeRectorTest */ -final class MessageHandlerInterfaceToAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class MessageHandlerInterfaceToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { public function __construct( private readonly MessengerHelper $messengerHelper, @@ -36,6 +38,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/messenger', '>=6.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector.php b/rules/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector.php index 484807163..37132858b 100644 --- a/rules/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector.php +++ b/rules/Symfony62/Rector/Class_/MessageSubscriberInterfaceToAttributeRector.php @@ -20,14 +20,16 @@ use Rector\Symfony\NodeManipulator\ClassManipulator; use Rector\ValueObject\MethodName; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony62\Rector\Class_\MessageSubscriberInterfaceToAttributeRector\MessageSubscriberInterfaceToAttributeRectorTest */ -final class MessageSubscriberInterfaceToAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class MessageSubscriberInterfaceToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { private string $newInvokeMethodName; @@ -44,6 +46,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/messenger', '>=6.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector.php b/rules/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector.php index 8b0de46ce..4fa9de8f0 100644 --- a/rules/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector.php +++ b/rules/Symfony72/Rector/StmtsAwareInterface/PushRequestToRequestStackConstructorRector.php @@ -19,6 +19,8 @@ use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -27,13 +29,18 @@ * * @see \Rector\Symfony\Tests\Symfony72\Rector\StmtsAwareInterface\PushRequestToRequestStackConstructorRector\PushRequestToRequestStackConstructorRectorTest */ -final class PushRequestToRequestStackConstructorRector extends AbstractRector +final class PushRequestToRequestStackConstructorRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly TestsNodeAnalyzer $testsNodeAnalyzer ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/http-foundation', '>=7.2'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition('Move push(request) to "Symfony\Component\HttpFoundation\RequestStack" constructor', [ diff --git a/rules/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector.php b/rules/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector.php index 13be79efb..746dcc159 100644 --- a/rules/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector.php +++ b/rules/Symfony73/Rector/Class_/AddVoteArgumentToVoteOnAttributeRector.php @@ -14,14 +14,21 @@ use PhpParser\Node\Stmt\Class_; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\AddVoteArgumentToVoteOnAttributeRector\AddVoteArgumentToVoteOnAttributeRectorTest */ -final class AddVoteArgumentToVoteOnAttributeRector extends AbstractRector +final class AddVoteArgumentToVoteOnAttributeRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/security-core', '>=7.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector.php b/rules/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector.php index 92dfa3200..f974652ee 100644 --- a/rules/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector.php +++ b/rules/Symfony73/Rector/Class_/AuthorizationCheckerToAccessDecisionManagerInVoterRector.php @@ -20,18 +20,25 @@ use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\AuthorizationCheckerToAccessDecisionManagerInVoterRector\AuthorizationCheckerToAccessDecisionManagerInVoterRectorTest */ -final class AuthorizationCheckerToAccessDecisionManagerInVoterRector extends AbstractRector +final class AuthorizationCheckerToAccessDecisionManagerInVoterRector extends AbstractRector implements ComposerPackageConstraintInterface { private const string AUTHORIZATION_CHECKER_PROPERTY = 'authorizationChecker'; private const string ACCESS_DECISION_MANAGER_PROPERTY = 'accessDecisionManager'; + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/security-core', '>=7.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector.php b/rules/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector.php index 944e6934a..53bee25db 100644 --- a/rules/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector.php +++ b/rules/Symfony73/Rector/Class_/CommandDefaultNameAndDescriptionToAsCommandAttributeRector.php @@ -18,6 +18,8 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyAttribute; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -26,8 +28,13 @@ * * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\CommandDefaultNameAndDescriptionToAsCommandAttributeRector\CommandDefaultNameAndDescriptionToAsCommandAttributeRectorTest */ -final class CommandDefaultNameAndDescriptionToAsCommandAttributeRector extends AbstractRector +final class CommandDefaultNameAndDescriptionToAsCommandAttributeRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/console', '>=7.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/CommandHelpToAttributeRector.php b/rules/Symfony73/Rector/Class_/CommandHelpToAttributeRector.php index dcd0104d8..33c9f7403 100644 --- a/rules/Symfony73/Rector/Class_/CommandHelpToAttributeRector.php +++ b/rules/Symfony73/Rector/Class_/CommandHelpToAttributeRector.php @@ -30,7 +30,9 @@ use Rector\Symfony\Enum\SymfonyAttribute; use Rector\Symfony\Enum\SymfonyClass; use Rector\ValueObject\PhpVersionFeature; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -39,7 +41,7 @@ * * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\CommandHelpToAttributeRector\CommandHelpToAttributeRectorTest */ -final class CommandHelpToAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class CommandHelpToAttributeRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { public function __construct( private readonly ReflectionProvider $reflectionProvider, @@ -52,6 +54,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::ATTRIBUTES; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/console', '>=7.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector.php b/rules/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector.php index d955df290..e1d3c25b6 100644 --- a/rules/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector.php +++ b/rules/Symfony73/Rector/Class_/ConstraintOptionsToNamedArgumentsRector.php @@ -16,19 +16,26 @@ use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\ConstraintOptionsToNamedArgumentsRector\ConstraintOptionsToNamedArgumentsRectorTest */ -final class ConstraintOptionsToNamedArgumentsRector extends AbstractRector +final class ConstraintOptionsToNamedArgumentsRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ValueResolver $valueResolver, ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/validator', '>=7.3'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector.php b/rules/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector.php index 4e671f929..c68f2ccb2 100644 --- a/rules/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector.php +++ b/rules/Symfony73/Rector/Class_/GetFiltersToAsTwigFilterAttributeRector.php @@ -10,6 +10,8 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\TwigClass; use Rector\Symfony\Symfony73\GetMethodToAsTwigAttributeTransformer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -18,13 +20,18 @@ * * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\GetFiltersToAsTwigFilterAttributeRector\GetFiltersToAsTwigFilterAttributeRectorTest */ -final class GetFiltersToAsTwigFilterAttributeRector extends AbstractRector +final class GetFiltersToAsTwigFilterAttributeRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly GetMethodToAsTwigAttributeTransformer $getMethodToAsTwigAttributeTransformer ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('twig/twig', '>=3.21'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector.php b/rules/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector.php index 9a7c54510..c474f264e 100644 --- a/rules/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector.php +++ b/rules/Symfony73/Rector/Class_/GetFunctionsToAsTwigFunctionAttributeRector.php @@ -10,6 +10,8 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\TwigClass; use Rector\Symfony\Symfony73\GetMethodToAsTwigAttributeTransformer; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -18,13 +20,18 @@ * * @see \Rector\Symfony\Tests\Symfony73\Rector\Class_\GetFunctionsToAsTwigFunctionAttributeRector\GetFunctionsToAsTwigFunctionAttributeRectorTest */ -final class GetFunctionsToAsTwigFunctionAttributeRector extends AbstractRector +final class GetFunctionsToAsTwigFunctionAttributeRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly GetMethodToAsTwigAttributeTransformer $getMethodToAsTwigAttributeTransformer, ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('twig/twig', '>=3.21'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony80/Rector/Class_/RemoveEraseCredentialsRector.php b/rules/Symfony80/Rector/Class_/RemoveEraseCredentialsRector.php index f9b139ff2..55118c9cd 100644 --- a/rules/Symfony80/Rector/Class_/RemoveEraseCredentialsRector.php +++ b/rules/Symfony80/Rector/Class_/RemoveEraseCredentialsRector.php @@ -11,6 +11,8 @@ use PhpParser\Node\Stmt\ClassMethod; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -19,8 +21,13 @@ * * @see \Rector\Symfony\Tests\Symfony80\Rector\Class_\RemoveEraseCredentialsRector\RemoveEraseCredentialsRectorTest */ -final class RemoveEraseCredentialsRector extends AbstractRector +final class RemoveEraseCredentialsRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/security-core', '>=8.0'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector.php b/rules/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector.php index d2b48e8cf..c543b0c75 100644 --- a/rules/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector.php +++ b/rules/Symfony81/Rector/MethodCall/ConstraintValidatorValidateToValidateInContextRector.php @@ -16,6 +16,8 @@ use PHPStan\Type\ObjectType; use Rector\PHPStan\ScopeFetcher; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\ConstraintValidatorInterface; use Symfony\Component\Validator\Test\ConstraintValidatorTestCase; @@ -30,13 +32,18 @@ * * @see \Rector\Symfony\Tests\Symfony81\Rector\MethodCall\ConstraintValidatorValidateToValidateInContextRector\ConstraintValidatorValidateToValidateInContextRectorTest */ -final class ConstraintValidatorValidateToValidateInContextRector extends AbstractRector +final class ConstraintValidatorValidateToValidateInContextRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ReflectionProvider $reflectionProvider ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/validator', '>=8.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector.php b/rules/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector.php index 33ed47767..24e8175b4 100644 --- a/rules/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector.php +++ b/rules/Symfony81/Rector/MethodCall/RenameCopyOnWindowsOptionToFollowSymlinksRector.php @@ -14,6 +14,8 @@ use PhpParser\Node\Scalar\String_; use PHPStan\Type\ObjectType; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -22,8 +24,13 @@ * * @see \Rector\Symfony\Tests\Symfony81\Rector\MethodCall\RenameCopyOnWindowsOptionToFollowSymlinksRector\RenameCopyOnWindowsOptionToFollowSymlinksRectorTest */ -final class RenameCopyOnWindowsOptionToFollowSymlinksRector extends AbstractRector +final class RenameCopyOnWindowsOptionToFollowSymlinksRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/filesystem', '>=8.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector.php b/rules/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector.php index e10c81356..f43f2cd3e 100644 --- a/rules/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector.php +++ b/rules/Symfony81/Rector/New_/RemoveEraseCredentialsFromAuthenticatorManagerRector.php @@ -10,6 +10,8 @@ use PhpParser\Node\Identifier; use Rector\PhpParser\Node\Value\ValueResolver; use Rector\Rector\AbstractRector; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -18,13 +20,18 @@ * * @see \Rector\Symfony\Tests\Symfony81\Rector\New_\RemoveEraseCredentialsFromAuthenticatorManagerRector\RemoveEraseCredentialsFromAuthenticatorManagerRectorTest */ -final class RemoveEraseCredentialsFromAuthenticatorManagerRector extends AbstractRector +final class RemoveEraseCredentialsFromAuthenticatorManagerRector extends AbstractRector implements ComposerPackageConstraintInterface { public function __construct( private readonly ValueResolver $valueResolver ) { } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/security-http', '>=8.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( diff --git a/rules/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector.php b/rules/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector.php index a8668273b..3055e1954 100644 --- a/rules/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector.php +++ b/rules/Symfony81/Rector/StaticCall/AddFormatArgumentToIsValidRector.php @@ -11,6 +11,8 @@ use PhpParser\Node\Name\FullyQualified; use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\SymfonyClass; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -19,8 +21,13 @@ * * @see \Rector\Symfony\Tests\Symfony81\Rector\StaticCall\AddFormatArgumentToIsValidRector\AddFormatArgumentToIsValidRectorTest */ -final class AddFormatArgumentToIsValidRector extends AbstractRector +final class AddFormatArgumentToIsValidRector extends AbstractRector implements ComposerPackageConstraintInterface { + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/uid', '>=8.1'); + } + public function getRuleDefinition(): RuleDefinition { return new RuleDefinition( From 758b64607a806a6a12af8224fab5ccdf7600b19e Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Mon, 3 Aug 2026 15:45:25 +0200 Subject: [PATCH 2/2] [composer-based] Bond MagicClosureTwigExtensionToNativeMethodsRector to symfony/twig-bridge 6.1 The rule already gates on PHP 8.1 for the first-class callable syntax it produces. The composer constraint pins the matching Symfony side: the first-class callable style in Twig extensions landed in symfony/twig-bridge 6.1, which itself requires PHP 8.1, so both gates open together. --- config/sets/symfony/composer-based.php | 4 ++++ ...agicClosureTwigExtensionToNativeMethodsRectorTest.php | 5 +++++ .../config/composer.json | 5 +++++ .../MagicClosureTwigExtensionToNativeMethodsRector.php | 9 ++++++++- 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/composer.json diff --git a/config/sets/symfony/composer-based.php b/config/sets/symfony/composer-based.php index 9538fcf46..34da21657 100644 --- a/config/sets/symfony/composer-based.php +++ b/config/sets/symfony/composer-based.php @@ -90,6 +90,7 @@ use Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector; use Rector\Symfony\Symfony61\Rector\Class_\CommandConfigureToAttributeRector; use Rector\Symfony\Symfony61\Rector\Class_\CommandPropertyToAttributeRector; +use Rector\Symfony\Symfony61\Rector\Class_\MagicClosureTwigExtensionToNativeMethodsRector; use Rector\Symfony\Symfony61\Rector\StaticPropertyFetch\ErrorNamesPropertyToConstantRector; use Rector\Symfony\Symfony62\Rector\Class_\MessageHandlerInterfaceToAttributeRector; use Rector\Symfony\Symfony62\Rector\Class_\MessageSubscriberInterfaceToAttributeRector; @@ -257,6 +258,9 @@ CommandConfigureToAttributeRector::class, CommandPropertyToAttributeRector::class, + // symfony/twig-bridge 6.1 + MagicClosureTwigExtensionToNativeMethodsRector::class, + // symfony/validator 6.1 ErrorNamesPropertyToConstantRector::class, diff --git a/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/MagicClosureTwigExtensionToNativeMethodsRectorTest.php b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/MagicClosureTwigExtensionToNativeMethodsRectorTest.php index 96a930403..94060ca55 100644 --- a/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/MagicClosureTwigExtensionToNativeMethodsRectorTest.php +++ b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/MagicClosureTwigExtensionToNativeMethodsRectorTest.php @@ -25,4 +25,9 @@ public function provideConfigFilePath(): string { return __DIR__ . '/config/configured_rule.php'; } + + protected function provideComposerJsonFilePath(): string + { + return __DIR__ . '/config/composer.json'; + } } diff --git a/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/composer.json b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/composer.json new file mode 100644 index 000000000..354405b36 --- /dev/null +++ b/rules-tests/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector/config/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "symfony/twig-bridge": "^6.1" + } +} diff --git a/rules/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector.php b/rules/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector.php index 1d5d8e5b9..ceb7355f6 100644 --- a/rules/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector.php +++ b/rules/Symfony61/Rector/Class_/MagicClosureTwigExtensionToNativeMethodsRector.php @@ -20,7 +20,9 @@ use Rector\Rector\AbstractRector; use Rector\Symfony\Enum\TwigClass; use Rector\ValueObject\PhpVersion; +use Rector\VersionBonding\Contract\ComposerPackageConstraintInterface; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\ValueObject\ComposerPackageConstraint; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -29,7 +31,7 @@ * * @see PHP 8.1 way to handle functions/filters https://github.com/symfony/symfony/blob/e0ad2eead3513a558c09d8aa3ae9e867fb10b419/src/Symfony/Bridge/Twig/Extension/CodeExtension.php#L41-L52 */ -final class MagicClosureTwigExtensionToNativeMethodsRector extends AbstractRector implements MinPhpVersionInterface +final class MagicClosureTwigExtensionToNativeMethodsRector extends AbstractRector implements MinPhpVersionInterface, ComposerPackageConstraintInterface { public function __construct( private readonly ArrayCallableMethodMatcher $arrayCallableMethodMatcher, @@ -136,6 +138,11 @@ public function provideMinPhpVersion(): int return PhpVersion::PHP_81; } + public function provideComposerPackageConstraint(): ComposerPackageConstraint + { + return new ComposerPackageConstraint('symfony/twig-bridge', '>=6.1'); + } + private function refactorClassMethod(ClassMethod $classMethod, Scope $scope): bool { $hasChanged = false;