diff --git a/rules/Php83/Rector/ClassMethod/AddOverrideAttributeToOverriddenMethodsRector.php b/rules/Php83/Rector/ClassMethod/AddOverrideAttributeToOverriddenMethodsRector.php index b8399f26300..81b3ee9902e 100644 --- a/rules/Php83/Rector/ClassMethod/AddOverrideAttributeToOverriddenMethodsRector.php +++ b/rules/Php83/Rector/ClassMethod/AddOverrideAttributeToOverriddenMethodsRector.php @@ -29,7 +29,9 @@ use Rector\Rector\AbstractRector; use Rector\ValueObject\MethodName; use Rector\ValueObject\PhpVersionFeature; +use Rector\ValueObject\PolyfillPackage; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\Contract\RelatedPolyfillInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -38,7 +40,7 @@ * * @see \Rector\Tests\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector\AddOverrideAttributeToOverriddenMethodsRectorTest */ -final class AddOverrideAttributeToOverriddenMethodsRector extends AbstractRector implements MinPhpVersionInterface, ConfigurableRectorInterface +final class AddOverrideAttributeToOverriddenMethodsRector extends AbstractRector implements MinPhpVersionInterface, RelatedPolyfillInterface, ConfigurableRectorInterface { /** * @api @@ -226,6 +228,11 @@ public function provideMinPhpVersion(): int return PhpVersionFeature::OVERRIDE_ATTRIBUTE; } + public function providePolyfillPackage(): string + { + return PolyfillPackage::PHP_83; + } + /** * @param ClassReflection[] $parentClassReflections */ diff --git a/rules/Php84/Rector/Class_/DeprecatedAnnotationToDeprecatedAttributeRector.php b/rules/Php84/Rector/Class_/DeprecatedAnnotationToDeprecatedAttributeRector.php index fd1e87b1752..74e1c56ffba 100644 --- a/rules/Php84/Rector/Class_/DeprecatedAnnotationToDeprecatedAttributeRector.php +++ b/rules/Php84/Rector/Class_/DeprecatedAnnotationToDeprecatedAttributeRector.php @@ -11,14 +11,16 @@ use Rector\PhpAttribute\DeprecatedAnnotationToDeprecatedAttributeConverter; use Rector\Rector\AbstractRector; use Rector\ValueObject\PhpVersionFeature; +use Rector\ValueObject\PolyfillPackage; use Rector\VersionBonding\Contract\MinPhpVersionInterface; +use Rector\VersionBonding\Contract\RelatedPolyfillInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * @see \Rector\Tests\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector\DeprecatedAnnotationToDeprecatedAttributeRectorTest */ -final class DeprecatedAnnotationToDeprecatedAttributeRector extends AbstractRector implements MinPhpVersionInterface +final class DeprecatedAnnotationToDeprecatedAttributeRector extends AbstractRector implements MinPhpVersionInterface, RelatedPolyfillInterface { public function __construct( private readonly DeprecatedAnnotationToDeprecatedAttributeConverter $deprecatedAnnotationToDeprecatedAttributeConverter, @@ -65,4 +67,9 @@ public function provideMinPhpVersion(): int { return PhpVersionFeature::DEPRECATED_ATTRIBUTE; } + + public function providePolyfillPackage(): string + { + return PolyfillPackage::PHP_84; + } } diff --git a/src/ValueObject/PolyfillPackage.php b/src/ValueObject/PolyfillPackage.php index 4e085e15761..f2d7822b0cd 100644 --- a/src/ValueObject/PolyfillPackage.php +++ b/src/ValueObject/PolyfillPackage.php @@ -9,8 +9,16 @@ */ final class PolyfillPackage { + public const string PHP_85 = 'symfony/polyfill-php85'; + + public const string PHP_84 = 'symfony/polyfill-php84'; + public const string PHP_83 = 'symfony/polyfill-php83'; + public const string PHP_82 = 'symfony/polyfill-php82'; + + public const string PHP_81 = 'symfony/polyfill-php81'; + public const string PHP_80 = 'symfony/polyfill-php80'; public const string PHP_73 = 'symfony/polyfill-php73';