diff --git a/config/sets/doctrine-code-quality.php b/config/sets/doctrine-code-quality.php index c7ea6b59..85e2124a 100644 --- a/config/sets/doctrine-code-quality.php +++ b/config/sets/doctrine-code-quality.php @@ -8,7 +8,6 @@ use Rector\Doctrine\CodeQuality\Rector\Class_\RemoveEmptyTableAttributeRector; use Rector\Doctrine\CodeQuality\Rector\Property\CorrectDefaultTypesOnEntityPropertyRector; use Rector\Doctrine\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector; -use Rector\Doctrine\CodeQuality\Rector\Property\MakeEntityDateTimePropertyDateTimeInterfaceRector; use Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromColumnTypeRector; use Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromToManyRelationTypeRector; use Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromToOneRelationTypeRector; @@ -17,7 +16,6 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->rules([ - MakeEntityDateTimePropertyDateTimeInterfaceRector::class, MoveCurrentDateTimeDefaultInEntityToConstructorRector::class, CorrectDefaultTypesOnEntityPropertyRector::class, diff --git a/phpstan.neon b/phpstan.neon index 03b43502..0033d29d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -52,3 +52,7 @@ parameters: # debug function - '#Function "d\(\)" cannot be used/left in the code#' + + - + identifier: classConstant.deprecatedClass + path: rules-tests/CodeQuality/Rector/Property/MakeEntityDateTimePropertyDateTimeInterfaceRector/config/configured_rule.php diff --git a/rules/CodeQuality/Rector/Property/MakeEntityDateTimePropertyDateTimeInterfaceRector.php b/rules/CodeQuality/Rector/Property/MakeEntityDateTimePropertyDateTimeInterfaceRector.php index e4fb7b23..29001d26 100644 --- a/rules/CodeQuality/Rector/Property/MakeEntityDateTimePropertyDateTimeInterfaceRector.php +++ b/rules/CodeQuality/Rector/Property/MakeEntityDateTimePropertyDateTimeInterfaceRector.php @@ -13,6 +13,7 @@ use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo; use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory; use Rector\Comments\NodeDocBlock\DocBlockUpdater; +use Rector\Configuration\Deprecation\Contract\DeprecatedInterface; use Rector\Doctrine\NodeAnalyzer\DoctrineEntityDetector; use Rector\NodeTypeResolver\PhpDoc\NodeAnalyzer\DocBlockClassRenamer; use Rector\NodeTypeResolver\ValueObject\OldToNewType; @@ -25,8 +26,10 @@ * @see related to maker bundle https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html * * @see \Rector\Doctrine\Tests\CodeQuality\Rector\Property\MakeEntityDateTimePropertyDateTimeInterfaceRector\MakeEntityDateTimePropertyDateTimeInterfaceRectorTest + * + * @deprecated see https://github.com/rectorphp/rector-doctrine/issues/356 for reasoning */ -final class MakeEntityDateTimePropertyDateTimeInterfaceRector extends AbstractRector +final class MakeEntityDateTimePropertyDateTimeInterfaceRector extends AbstractRector implements DeprecatedInterface { public function __construct( private readonly DocBlockClassRenamer $docBlockClassRenamer,