Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -226,6 +228,11 @@ public function provideMinPhpVersion(): int
return PhpVersionFeature::OVERRIDE_ATTRIBUTE;
}

public function providePolyfillPackage(): string
{
return PolyfillPackage::PHP_83;
}

/**
* @param ClassReflection[] $parentClassReflections
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -65,4 +67,9 @@ public function provideMinPhpVersion(): int
{
return PhpVersionFeature::DEPRECATED_ATTRIBUTE;
}

public function providePolyfillPackage(): string
{
return PolyfillPackage::PHP_84;
}
}
8 changes: 8 additions & 0 deletions src/ValueObject/PolyfillPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading