Skip to content

Commit

Permalink
deprecate InitializeDefaultEntityCollectionRector, use ExplicitRelati…
Browse files Browse the repository at this point in the history
…onCollectionRector instead
  • Loading branch information
TomasVotruba committed Mar 21, 2024
1 parent 8faab79 commit 10195d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/sets/doctrine-code-quality.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Rector\Config\RectorConfig;
use Rector\Doctrine\CodeQuality\Rector\Class_\ExplicitRelationCollectionRector;
use Rector\Doctrine\CodeQuality\Rector\Class_\InitializeDefaultEntityCollectionRector;
use Rector\Doctrine\CodeQuality\Rector\Class_\MoveCurrentDateTimeDefaultInEntityToConstructorRector;
use Rector\Doctrine\CodeQuality\Rector\Class_\RemoveEmptyTableAttributeRector;
use Rector\Doctrine\CodeQuality\Rector\Property\CorrectDefaultTypesOnEntityPropertyRector;
Expand All @@ -22,9 +21,10 @@
MakeEntityDateTimePropertyDateTimeInterfaceRector::class,
MoveCurrentDateTimeDefaultInEntityToConstructorRector::class,
CorrectDefaultTypesOnEntityPropertyRector::class,
ImproveDoctrineCollectionDocTypeInEntityRector::class,
InitializeDefaultEntityCollectionRector::class,

ExplicitRelationCollectionRector::class,
ImproveDoctrineCollectionDocTypeInEntityRector::class,

RemoveEmptyTableAttributeRector::class,

// typed properties in entities from annotations/attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/best-practices.html#initialize-collections-in-the-constructor
*
* @see \Rector\Doctrine\Tests\CodeQuality\Rector\Class_\InitializeDefaultEntityCollectionRector\InitializeDefaultEntityCollectionRectorTest
*
* @deprecated This rule can create incomplete assign of object to an array. Use the @see \Rector\Doctrine\CodeQuality\Rector\Class_\ExplicitRelationCollectionRector instead.
*/
final class InitializeDefaultEntityCollectionRector extends AbstractRector
{
Expand Down

0 comments on commit 10195d4

Please sign in to comment.