From 880b622fe6260e4978b027ab6e3e87566afc4868 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Tue, 4 Oct 2022 14:13:44 +0200 Subject: [PATCH 1/9] Fix heading levels for the embeddable tutorial --- docs/en/tutorials/embeddables.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/embeddables.rst b/docs/en/tutorials/embeddables.rst index 483e58d9da6..507ef22d35e 100644 --- a/docs/en/tutorials/embeddables.rst +++ b/docs/en/tutorials/embeddables.rst @@ -1,5 +1,5 @@ Separating Concerns using Embeddables -------------------------------------- +===================================== Embeddables are classes which are not entities themselves, but are embedded in entities and can also be queried in DQL. You'll mostly want to use them From 18366db5789b03e1d8a34933fbbff97a768a9cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 21:38:38 +0200 Subject: [PATCH 2/9] Remove reference to JoinColumns While that class can be an annotation, it cannot be an attribute because it is not necessary when using attributes. See https://github.com/doctrine/orm/issues/9986 --- docs/en/reference/attributes-reference.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/en/reference/attributes-reference.rst b/docs/en/reference/attributes-reference.rst index e7e015d4acd..c3b902de2f4 100644 --- a/docs/en/reference/attributes-reference.rst +++ b/docs/en/reference/attributes-reference.rst @@ -27,7 +27,6 @@ Index - :ref:`#[Id] ` - :ref:`#[InheritanceType] ` - :ref:`#[JoinColumn] ` -- :ref:`#[JoinColumns] ` - :ref:`#[JoinTable] ` - :ref:`#[ManyToOne] ` - :ref:`#[ManyToMany] ` From d36004f82589d113620da384c6b7bec0c4f9dd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 21:39:31 +0200 Subject: [PATCH 3/9] Remove trailing whitespace --- docs/en/reference/attributes-reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/attributes-reference.rst b/docs/en/reference/attributes-reference.rst index c3b902de2f4..32f1c1cff7e 100644 --- a/docs/en/reference/attributes-reference.rst +++ b/docs/en/reference/attributes-reference.rst @@ -178,7 +178,7 @@ Optional parameters: If not specified, default value is ``false``. - **insertable**: Boolean value to determine if the column should be - included when inserting a new row into the underlying entities table. + included when inserting a new row into the underlying entities table. If not specified, default value is true. - **updatable**: Boolean value to determine if the column should be From d95d8d0a19129404f4cc1fa899bcb2435479c816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 21:40:09 +0200 Subject: [PATCH 4/9] Fix broken links --- docs/en/reference/attributes-reference.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/attributes-reference.rst b/docs/en/reference/attributes-reference.rst index 32f1c1cff7e..f0a8e2ec722 100644 --- a/docs/en/reference/attributes-reference.rst +++ b/docs/en/reference/attributes-reference.rst @@ -10,8 +10,8 @@ annotation metadata supported since the first version 2.0. Index ----- -- :ref:`#[AssociationOverride] ` +- :ref:`#[AttributeOverride] ` - :ref:`#[Column] ` - :ref:`#[Cache] ` - :ref:`#[ChangeTrackingPolicy ` From 5fbcb1833453c0159ec7241f811457585530b3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 21:55:24 +0200 Subject: [PATCH 5/9] Spell cities properly --- tests/Doctrine/Tests/Models/Cache/City.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/Models/Cache/City.php b/tests/Doctrine/Tests/Models/Cache/City.php index 13246d50ae8..09cf8703da7 100644 --- a/tests/Doctrine/Tests/Models/Cache/City.php +++ b/tests/Doctrine/Tests/Models/Cache/City.php @@ -51,7 +51,7 @@ class City * @JoinColumn(name="state_id", referencedColumnName="id") */ #[ORM\Cache] - #[ORM\ManyToOne(targetEntity: 'State', inversedBy: 'citities')] + #[ORM\ManyToOne(targetEntity: 'State', inversedBy: 'cities')] #[ORM\JoinColumn(name: 'state_id', referencedColumnName: 'id')] protected $state; From 5a528bef5d611b1eb6ce50776a72da29609b8c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 21:55:36 +0200 Subject: [PATCH 6/9] Use short class name It is more friendly with conversion to attributes --- .../Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php | 2 +- tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php | 4 ++-- tests/Doctrine/Tests/ORM/Functional/Ticket/GH7012Test.php | 2 +- tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php index da847f34769..181b7fad54d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php @@ -125,7 +125,7 @@ class DDC5684Object /** * @var DDC5684ObjectIdType * @Id - * @Column(type=Doctrine\Tests\ORM\Functional\Ticket\DDC5684ObjectIdType::class) + * @Column(type=DDC5684ObjectIdType::class) * @GeneratedValue(strategy="AUTO") */ public $id; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php index 6bb6badeda1..102609d93f0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php @@ -153,8 +153,8 @@ public function __toString(): string * @InheritanceType("JOINED") * @DiscriminatorColumn(name="discr", type="gh6141people") * @DiscriminatorMap({ - * Doctrine\Tests\ORM\Functional\Ticket\GH6141People::BOSS = GH6141Boss::class, - * Doctrine\Tests\ORM\Functional\Ticket\GH6141People::EMPLOYEE = GH6141Employee::class + * GH6141People::BOSS = GH6141Boss::class, + * GH6141People::EMPLOYEE = GH6141Employee::class * }) */ abstract class GH6141Person diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7012Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7012Test.php index 4421a4ce465..836f40ce253 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7012Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7012Test.php @@ -58,7 +58,7 @@ class GH7012UserData /** * @var QuotedUser * @Id - * @OneToOne(targetEntity=Doctrine\Tests\Models\Quote\User::class) + * @OneToOne(targetEntity=QuotedUser::class) * @JoinColumn(name="`user-id`", referencedColumnName="`user-id`", onDelete="CASCADE") */ public $user; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php index 253138ed6db..fa58570274f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7512Test.php @@ -48,8 +48,8 @@ public function testFindEntityByAssociationPropertyJoinedChildWithClearMetadata( * @Entity() * @InheritanceType("JOINED") * @DiscriminatorMap({ - * "entitya"=Doctrine\Tests\ORM\Functional\Ticket\GH7512EntityA::class, - * "entityB"=Doctrine\Tests\ORM\Functional\Ticket\GH7512EntityB::class + * "entitya"=GH7512EntityA::class, + * "entityB"=GH7512EntityB::class * }) */ class GH7512EntityA @@ -63,7 +63,7 @@ class GH7512EntityA public $id; /** - * @OneToMany(targetEntity="Doctrine\Tests\ORM\Functional\Ticket\GH7512EntityC", mappedBy="entityA") + * @OneToMany(targetEntity="GH7512EntityC", mappedBy="entityA") * @var Collection */ public $entityCs; @@ -86,7 +86,7 @@ class GH7512EntityC public $id; /** - * @ManyToOne(targetEntity="Doctrine\Tests\ORM\Functional\Ticket\GH7512EntityA", inversedBy="entityCs") + * @ManyToOne(targetEntity="GH7512EntityA", inversedBy="entityCs") * @var GH7512EntityA */ public $entityA; From 021722acc762db0475b12a3371bd24fccf941fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 5 Oct 2022 22:14:49 +0200 Subject: [PATCH 7/9] Remove ignored annotation Making it a separate, valid annotation breaks the tests --- tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php index 90dd6b4cda8..c88de7e28ae 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php @@ -366,7 +366,7 @@ class DDC1649Two { /** * @var DDC1649One - * @Id @ManyToOne(targetEntity="DDC1649One")@JoinColumn(name="id", referencedColumnName="id") + * @Id @ManyToOne(targetEntity="DDC1649One") */ public $one; } From dd8c7003b87bcefc9097c31572784832b1c881bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 6 Oct 2022 08:44:01 +0200 Subject: [PATCH 8/9] Assert that serialization leaves PersistentCollection usable That feature is no longer covered since support for merging entities in the entity manager was removed. --- tests/Doctrine/Tests/ORM/PersistentCollectionTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php b/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php index faaa05b9ff0..704799c9e34 100644 --- a/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php @@ -21,6 +21,8 @@ use function array_keys; use function assert; use function method_exists; +use function serialize; +use function unserialize; /** * Tests the lazy-loading capabilities of the PersistentCollection and the initialization of collections. @@ -286,4 +288,13 @@ public function testModifyUOWForDeferredImplicitOwnerOnClear(): void $this->collection->clear(); } + + public function testItCanBeSerializedAndUnserializedBack(): void + { + $this->collection->add(new stdClass()); + $collection = unserialize(serialize($this->collection)); + $collection->add(new stdClass()); + $collection[3] = new stdClass(); + self::assertCount(3, $collection); + } } From e8ac1169adccd706c3853901b474712be2b54864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 6 Oct 2022 16:57:00 +0200 Subject: [PATCH 9/9] Bump CI workflows (#10106) --- .github/workflows/coding-standard.yml | 2 +- .github/workflows/continuous-integration.yml | 34 +++++++++---------- .github/workflows/phpbench.yml | 4 +-- .../workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 8 ++--- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index d861ff8cf5d..04b2556460e 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -10,4 +10,4 @@ on: jobs: coding-standards: - uses: "doctrine/.github/.github/workflows/coding-standards.yml@2.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@2.1.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b44eb524962..3beb186da82 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -36,7 +36,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -53,7 +53,7 @@ jobs: if: "${{ matrix.dbal-version != 'default' }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: "--ignore-platform-req=php+" @@ -68,7 +68,7 @@ jobs: ENABLE_SECOND_LEVEL_CACHE: 1 - name: "Upload coverage file" - uses: "actions/upload-artifact@v2" + uses: "actions/upload-artifact@v3" with: name: "phpunit-sqlite-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage" path: "coverage*.xml" @@ -110,7 +110,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -126,7 +126,7 @@ jobs: if: "${{ matrix.dbal-version != 'default' }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: "--ignore-platform-req=php+" @@ -134,7 +134,7 @@ jobs: run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml --coverage-clover=coverage.xml" - name: "Upload coverage file" - uses: "actions/upload-artifact@v2" + uses: "actions/upload-artifact@v3" with: name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage" path: "coverage.xml" @@ -185,7 +185,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -202,7 +202,7 @@ jobs: extensions: "${{ matrix.extension }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: "--ignore-platform-req=php+" @@ -210,7 +210,7 @@ jobs: run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" - name: "Upload coverage file" - uses: "actions/upload-artifact@v2" + uses: "actions/upload-artifact@v3" with: name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage" path: "coverage.xml" @@ -261,7 +261,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -278,7 +278,7 @@ jobs: if: "${{ matrix.dbal-version != 'default' }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: composer-options: "--ignore-platform-req=php+" @@ -293,7 +293,7 @@ jobs: ENABLE_SECOND_LEVEL_CACHE: 1 - name: "Upload coverage files" - uses: "actions/upload-artifact@v2" + uses: "actions/upload-artifact@v3" with: name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage" path: "coverage*.xml" @@ -313,7 +313,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -324,7 +324,7 @@ jobs: ini-values: "zend.assertions=1" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "${{ matrix.deps }}" @@ -343,16 +343,16 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 - name: "Download coverage files" - uses: "actions/download-artifact@v2" + uses: "actions/download-artifact@v3" with: path: "reports" - name: "Upload to Codecov" - uses: "codecov/codecov-action@v1" + uses: "codecov/codecov-action@v3" with: directory: reports diff --git a/.github/workflows/phpbench.yml b/.github/workflows/phpbench.yml index 4924834a396..097473806f0 100644 --- a/.github/workflows/phpbench.yml +++ b/.github/workflows/phpbench.yml @@ -24,7 +24,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" with: fetch-depth: 2 @@ -36,7 +36,7 @@ jobs: ini-values: "zend.assertions=1" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2" + uses: "actions/cache@v3" with: path: "~/.composer/cache" key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 0e473ab4780..2dfa3c02645 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -7,7 +7,7 @@ on: jobs: release: - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.0.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.1.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 830c9635858..0cb0504a275 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -33,7 +33,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -50,7 +50,7 @@ jobs: if: "${{ matrix.persistence-version != 'default' }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "highest" @@ -78,7 +78,7 @@ jobs: steps: - name: "Checkout code" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Install PHP" uses: "shivammathur/setup-php@v2" @@ -87,7 +87,7 @@ jobs: php-version: "${{ matrix.php-version }}" - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v1" + uses: "ramsey/composer-install@v2" with: dependency-versions: "highest"