From 5c086cbbe5327937dd6f90da075f7d421b0f28bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Thu, 6 Jan 2022 09:54:40 +0100 Subject: [PATCH 1/6] Fix remaining test failures --- Tests/DependencyInjection/ConfigurationTest.php | 8 ++++++++ composer.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index 19ecd7528..e4227ecf9 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -6,6 +6,9 @@ use PHPUnit\Framework\TestCase; use function class_exists; +use function extension_loaded; + +use const PHP_VERSION_ID; class ConfigurationTest extends TestCase { @@ -23,8 +26,13 @@ class ConfigurationTest extends TestCase /** @runInSeparateProcess */ public function testGetConfigTreeBuilderDoNotUseDoctrineCommon(): void { + if (extension_loaded('pcov') && PHP_VERSION_ID >= 80100) { + $this->markTestSkipped('Segfaults, see https://github.com/krakjoe/pcov/issues/84'); + } + $configuration = new Configuration(true); $configuration->getConfigTreeBuilder(); + $this->assertFalse(class_exists('Doctrine\Common\Proxy\AbstractProxyFactory', false)); } } diff --git a/composer.json b/composer.json index 9b51b86af..bcae79c42 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "symfony/cache": "^4.3.3|^5.0|^6.0", "symfony/config": "^4.4.3|^5.0|^6.0", "symfony/console": "^3.4.30|^4.3.3|^5.0|^6.0", - "symfony/dependency-injection": "^4.3.3|^5.0|^6.0", + "symfony/dependency-injection": "^4.4.18|^5.0|^6.0", "symfony/deprecation-contracts": "^2.1|^3", "symfony/doctrine-bridge": "^4.4.22|^5.2.7|^6.0", "symfony/framework-bundle": "^3.4.30|^4.3.3|^5.0|^6.0", From 100687e17077034c3ef47a0d6ecf06bd41c8ca07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Sat, 12 Feb 2022 13:24:49 +0100 Subject: [PATCH 2/6] Stop declaring doctrine/orm 3.x compatibility ORM 3.x support is broken currently --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bcae79c42..d21288c5f 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ } }, "conflict": { - "doctrine/orm": "<2.9", + "doctrine/orm": "<2.9|>=3.0", "twig/twig": "<1.34|>=2.0,<2.4" }, "suggest": { From f1f034bc0bb4953535e9a60580fd71f4bc14da28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 12 Feb 2022 22:05:55 +0100 Subject: [PATCH 3/6] Drop useless guard condition Apparently it was added in a08bc3b4d8567cdff05e89b272ba1e06e9d71c21 to satisfy Psalm. Either there was an issue with that version of Psalm or more helpful phpdoc was added to upstream packages, which makes this code block redundant. --- Mapping/ClassMetadataFactory.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Mapping/ClassMetadataFactory.php b/Mapping/ClassMetadataFactory.php index c84cfd2d7..a04a16ab5 100644 --- a/Mapping/ClassMetadataFactory.php +++ b/Mapping/ClassMetadataFactory.php @@ -5,7 +5,6 @@ use Doctrine\ORM\Id\AbstractIdGenerator; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory as BaseClassMetadataFactory; -use Doctrine\ORM\Mapping\ClassMetadataInfo; use function assert; @@ -18,10 +17,6 @@ protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonS { parent::doLoadMetadata($class, $parent, $rootEntityFound, $nonSuperclassParents); - if (! $class instanceof ClassMetadataInfo) { - return; - } - $customGeneratorDefinition = $class->customGeneratorDefinition; if (! isset($customGeneratorDefinition['instance'])) { From eec8f555b6e71b8fbee5f5b0f221ca19120b2911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 12 Feb 2022 22:09:15 +0100 Subject: [PATCH 4/6] Comply with class-string requirement This class implements an interface that requires getClassName() to return a class-string. --- Tests/Repository/ContainerRepositoryFactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Repository/ContainerRepositoryFactoryTest.php b/Tests/Repository/ContainerRepositoryFactoryTest.php index 28dbd3c11..eac247801 100644 --- a/Tests/Repository/ContainerRepositoryFactoryTest.php +++ b/Tests/Repository/ContainerRepositoryFactoryTest.php @@ -210,7 +210,7 @@ public function findOneBy(array $criteria) public function getClassName(): string { - return ''; + return stdClass::class; } } From 99cc3b3d83b9d5a9f4db57f4800bc03694e8dda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 12 Feb 2022 22:12:24 +0100 Subject: [PATCH 5/6] Require php 8 Attributes are available since PHP 8. --- Tests/DependencyInjection/DoctrineExtensionTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/DependencyInjection/DoctrineExtensionTest.php b/Tests/DependencyInjection/DoctrineExtensionTest.php index 02dc4be0b..f3fcf23ea 100644 --- a/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -764,12 +764,11 @@ public function testAnnotationsBundleMappingDetection(): void ]); } + /** + * @requires PHP 8 + */ public function testAttributesBundleMappingDetection(): void { - if (PHP_VERSION_ID < 70400) { - self::markTestSkipped('This test requires PHP 7.4.'); - } - $container = $this->getContainer(['AttributesBundle']); $extension = new DoctrineExtension(); From b2fa2aa31ea582a68cb678e34cb36266a8dbdb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 12 Feb 2022 22:26:01 +0100 Subject: [PATCH 6/6] Run phpcs with stable dependencies This option was overlooked when migrating to reusable workflows. --- .github/workflows/coding-standards.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index f8b5b6096..856dda725 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -13,3 +13,5 @@ jobs: coding-standards: name: "Coding Standards" uses: "doctrine/.github/.github/workflows/coding-standards.yml@1.4.1" + with: + composer-options: "--prefer-dist --prefer-stable"