Skip to content

Commit

Permalink
[ORM-219] fixes #306 use correct version number (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohJohan authored Mar 5, 2025
1 parent 39daccd commit 02ca76d
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 44 deletions.
File renamed without changes.
9 changes: 8 additions & 1 deletion src/Set/DoctrineSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ final class DoctrineSetList

/**
* @var string
*
* @deprecated please use DOCTRINE_ORM_219 @see https://github.com/rectorphp/rector-doctrine/issues/306
*/
public const DOCTRINE_ORM_29 = __DIR__ . '/../../config/sets/doctrine-orm-29.php';
public const DOCTRINE_ORM_29 = __DIR__ . '/../../config/sets/doctrine-orm-219.php';

/**
* @var string
Expand All @@ -74,6 +76,11 @@ final class DoctrineSetList
*/
public const DOCTRINE_ORM_214 = __DIR__ . '/../../config/sets/doctrine-orm-214.php';

/**
* @var string
*/
public const DOCTRINE_ORM_219 = __DIR__.'/../../config/sets/doctrine-orm-219.php';

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

final class DoctrineORM29SetTest extends AbstractRectorTestCase
final class DoctrineORM219SetTest extends AbstractRectorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -18,7 +18,7 @@ class AnEntity
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\ChangeTrackingPolicy;
Expand All @@ -17,7 +17,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\ChangeTrackingPolicy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\CustomIdGenerator;

Expand All @@ -16,7 +16,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\CustomIdGenerator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Embeddable;
use Doctrine\ORM\Mapping\Embedded;
Expand All @@ -24,7 +24,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Embeddable;
use Doctrine\ORM\Mapping\Embedded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand Down Expand Up @@ -42,7 +42,7 @@ class News

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\PostLoad;
Expand Down Expand Up @@ -66,7 +66,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\PostLoad;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\InheritanceType;
Expand All @@ -25,7 +25,7 @@ class Person

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\InheritanceType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\Entity;
Expand All @@ -24,7 +24,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\Entity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\MappedSuperclass;

Expand All @@ -15,7 +15,7 @@ abstract class BaseEntity
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\MappedSuperclass;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\OneToMany;

Expand All @@ -16,7 +16,7 @@ class Product
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\OneToMany;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\OrderBy;

Expand All @@ -16,7 +16,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\OrderBy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
Expand Down Expand Up @@ -46,7 +46,7 @@ class Age extends FunctionNode
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\SequenceGenerator;

Expand All @@ -16,7 +16,7 @@ class User
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\SequenceGenerator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Index;
Expand All @@ -20,7 +20,7 @@ final class TableAndNestedIndex

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Index;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -19,7 +19,7 @@ class UnwrapJoinColumns
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Version;
Expand All @@ -22,7 +22,7 @@ class ECommerceProduct

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\Fixture;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\Fixture;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Version;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -19,7 +19,7 @@ final class DecoupleJoinColumns
-----
<?php

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -24,7 +24,7 @@ class Overrides

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -19,7 +19,7 @@ class TableAndNestedIndex

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set\FixturePhp81;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set\FixturePhp81;

use Doctrine\ORM\Mapping as ORM;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Doctrine\Tests\Set\DoctrineORM29Set;
namespace Rector\Doctrine\Tests\Set\DoctrineORM219Set;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Rector\ValueObject\PhpVersionFeature;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DoctrineSetList::DOCTRINE_ORM_29]);
$rectorConfig->sets([DoctrineSetList::DOCTRINE_ORM_219]);

$rectorConfig->phpVersion(PhpVersionFeature::NEW_INITIALIZERS - 1);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Rector\ValueObject\PhpVersionFeature;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([DoctrineSetList::DOCTRINE_ORM_29]);
$rectorConfig->sets([DoctrineSetList::DOCTRINE_ORM_219]);

$rectorConfig->phpVersion(PhpVersionFeature::NEW_INITIALIZERS);
};

0 comments on commit 02ca76d

Please sign in to comment.