From d59e6ef7caffe6a30f4b6f9e9079a75f52c64ae0 Mon Sep 17 00:00:00 2001 From: HypeMC <2445045+HypeMC@users.noreply.github.com> Date: Tue, 21 Oct 2025 17:21:39 +0200 Subject: [PATCH 1/6] Revert `MappingDriverChain` namespace matching fix (#455) --- .../Mapping/Driver/MappingDriverChain.php | 14 +++----------- tests/Persistence/Mapping/DriverChainTest.php | 10 +++++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/Persistence/Mapping/Driver/MappingDriverChain.php b/src/Persistence/Mapping/Driver/MappingDriverChain.php index e156eaa5..8563dd23 100644 --- a/src/Persistence/Mapping/Driver/MappingDriverChain.php +++ b/src/Persistence/Mapping/Driver/MappingDriverChain.php @@ -8,7 +8,6 @@ use Doctrine\Persistence\Mapping\MappingException; use function array_keys; -use function rtrim; use function spl_object_hash; use function strpos; @@ -74,7 +73,7 @@ public function getDrivers() public function loadMetadataForClass(string $className, ClassMetadata $metadata) { foreach ($this->drivers as $namespace => $driver) { - if ($this->isInNamespace($className, $namespace)) { + if (strpos($className, $namespace) === 0) { $driver->loadMetadataForClass($className, $metadata); return; @@ -106,7 +105,7 @@ public function getAllClassNames() } foreach ($driverClasses[$oid] as $className) { - if (! $this->isInNamespace($className, $namespace)) { + if (strpos($className, $namespace) !== 0) { continue; } @@ -129,7 +128,7 @@ public function getAllClassNames() public function isTransient(string $className) { foreach ($this->drivers as $namespace => $driver) { - if ($this->isInNamespace($className, $namespace)) { + if (strpos($className, $namespace) === 0) { return $driver->isTransient($className); } } @@ -140,11 +139,4 @@ public function isTransient(string $className) return true; } - - private function isInNamespace(string $className, string $namespace): bool - { - $namespace = rtrim($namespace, '\\') . '\\'; - - return strpos($className, $namespace) === 0; - } } diff --git a/tests/Persistence/Mapping/DriverChainTest.php b/tests/Persistence/Mapping/DriverChainTest.php index a0259898..b196d9cb 100644 --- a/tests/Persistence/Mapping/DriverChainTest.php +++ b/tests/Persistence/Mapping/DriverChainTest.php @@ -16,10 +16,10 @@ class DriverChainTest extends DoctrineTestCase { /** - * @testWith ["Doctrine\\Tests\\Models\\Company"] - * ["Doctrine\\Tests\\Persistence\\Map"] + * @testWith ["Doctrine\\Tests\\Models\\Company", "Doctrine\\Tests\\Persistence\\Mapping"] + * ["Doctrine\\Tests\\Persistence\\Map\\", "Doctrine\\Tests\\Persistence\\Map"] */ - public function testDelegateToMatchingNamespaceDriver(string $namespace): void + public function testDelegateToMatchingNamespaceDriver(string $namespace1, string $namespace2): void { $className = DriverChainEntity::class; $classMetadata = $this->createMock(ClassMetadata::class); @@ -41,8 +41,8 @@ public function testDelegateToMatchingNamespaceDriver(string $namespace): void ->with(self::equalTo($className)) ->willReturn(true); - $chain->addDriver($driver1, $namespace); - $chain->addDriver($driver2, 'Doctrine\Tests\Persistence\Mapping'); + $chain->addDriver($driver1, $namespace1); + $chain->addDriver($driver2, $namespace2); $chain->loadMetadataForClass($className, $classMetadata); From 22dfdbeee1f88201f2c657c2763b998e4b760206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 16 Oct 2025 22:24:28 +0200 Subject: [PATCH 2/6] Show more details about errors in PHPUnit --- phpunit.xml.dist | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bc4533ac..80346b48 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,7 +4,12 @@ colors="true" beStrictAboutOutputDuringTests="true" displayDetailsOnPhpunitDeprecations="true" - displayDetailsOnTestsThatTriggerDeprecations="true" + failOnDeprecation="true" + failOnNotice="true" + failOnWarning="true" + failOnIncomplete="true" + failOnRisky="true" + failOnEmptyTestSuite="true" > From ebfc5e17df0421274b68fc0c568af9d4bbf51a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 21 Oct 2025 17:27:52 +0200 Subject: [PATCH 3/6] displayDetailsOnTestsThatTriggerDeprecations --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 80346b48..17c0ba0c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,6 +4,7 @@ colors="true" beStrictAboutOutputDuringTests="true" displayDetailsOnPhpunitDeprecations="true" + displayDetailsOnTestsThatTriggerDeprecations="true" failOnDeprecation="true" failOnNotice="true" failOnWarning="true" From 6e1cf15c901d936974e7761d879969eb8beb4e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 21 Oct 2025 19:53:57 +0200 Subject: [PATCH 4/6] Use --do-not-fail-on-deprecation for lowest dependencies --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/continuous-integration.yml | 3 ++- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/website-schema.yml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 14f07c96..a5a28bba 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -12,4 +12,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@12.1.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 85a30fdd..498a7ca7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,8 +12,9 @@ on: jobs: phpunit: name: "PHPUnit" - uses: "doctrine/.github/.github/workflows/continuous-integration.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/continuous-integration.yml@12.1.0" with: php-versions: '["8.1", "8.2", "8.3", "8.4", "8.5"]' + phpunit-options-lowest: "--do-not-fail-on-deprecation" secrets: CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 329e5571..89dba39e 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@12.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 595cd96d..355099da 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,4 +12,4 @@ on: jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/phpstan.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@12.1.0" diff --git a/.github/workflows/website-schema.yml b/.github/workflows/website-schema.yml index e251588e..f56b7241 100644 --- a/.github/workflows/website-schema.yml +++ b/.github/workflows/website-schema.yml @@ -18,4 +18,4 @@ on: jobs: json-validate: name: "Validate JSON schema" - uses: "doctrine/.github/.github/workflows/website-schema.yml@7.1.0" + uses: "doctrine/.github/.github/workflows/website-schema.yml@12.1.0" From acde25ea5d4442797344d5fa6a5b0e52f7979cec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:08:31 +0000 Subject: [PATCH 5/6] Bump doctrine/.github from 12.0.0 to 12.1.0 Bumps [doctrine/.github](https://github.com/doctrine/.github) from 12.0.0 to 12.1.0. - [Release notes](https://github.com/doctrine/.github/releases) - [Commits](https://github.com/doctrine/.github/compare/12.0.0...12.1.0) --- updated-dependencies: - dependency-name: doctrine/.github dependency-version: 12.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/continuous-integration.yml | 2 +- .github/workflows/release-on-milestone-closed.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index f115b910..0ad9b907 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -12,6 +12,6 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@12.1.0" with: composer-root-version: "3.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ebfb6df3..1db68268 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,7 +12,7 @@ on: jobs: phpunit: name: "PHPUnit" - uses: "doctrine/.github/.github/workflows/continuous-integration.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/continuous-integration.yml@12.1.0" with: composer-root-version: "3.0" php-versions: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]' diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 329e5571..89dba39e 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@12.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 7974f99d..0f0fa07e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,6 +12,6 @@ on: jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/phpstan.yml@12.0.0" + uses: "doctrine/.github/.github/workflows/phpstan.yml@12.1.0" with: composer-root-version: "3.0" From 4431dcf375ca7e6a24ee4a761ad8f1a4072d71ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 30 Oct 2025 08:34:44 +0100 Subject: [PATCH 6/6] Setup documentation workflow --- .github/workflows/documentation.yml | 20 ++++++++++++++++++++ composer.json | 3 +++ docs/.gitignore | 3 +++ docs/composer.json | 5 +++++ docs/en/sidebar.rst | 2 ++ 5 files changed, 33 insertions(+) create mode 100644 .github/workflows/documentation.yml create mode 100644 docs/.gitignore create mode 100644 docs/composer.json diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 00000000..90c54d67 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,20 @@ +name: "Documentation" + +on: + pull_request: + branches: + - "*.x" + paths: + - .github/workflows/documentation.yml + - docs/** + push: + branches: + - "*.x" + paths: + - .github/workflows/documentation.yml + - docs/** + +jobs: + documentation: + name: "Documentation" + uses: "doctrine/.github/.github/workflows/documentation.yml@12.2.0" diff --git a/composer.json b/composer.json index ca364c9d..207ecfd6 100644 --- a/composer.json +++ b/composer.json @@ -53,5 +53,8 @@ "dealerdirect/phpcodesniffer-composer-installer": true, "composer/package-versions-deprecated": true } + }, + "scripts": { + "docs": "composer --working-dir docs update && ./docs/vendor/bin/build-docs.sh @additional_args" } } diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..f26c03fc --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,3 @@ +/composer.lock +/vendor/ +/output/ diff --git a/docs/composer.json b/docs/composer.json new file mode 100644 index 00000000..c5a4e144 --- /dev/null +++ b/docs/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "doctrine/docs-builder": "^1.0" + } +} diff --git a/docs/en/sidebar.rst b/docs/en/sidebar.rst index f89f2bba..f18d38f4 100644 --- a/docs/en/sidebar.rst +++ b/docs/en/sidebar.rst @@ -1,3 +1,5 @@ +:orphan: + .. toctree:: :depth: 3