From c808a0c85c38c8ee265cc8405b456c1d2b38567d Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 19 Nov 2023 13:48:54 +0100 Subject: [PATCH] Add support for doctrine/orm 3 (#415) --- Tests/IntegrationTest.php | 15 +++++++++++---- composer.json | 2 +- psalm.xml | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Tests/IntegrationTest.php b/Tests/IntegrationTest.php index 37feb82..524696e 100644 --- a/Tests/IntegrationTest.php +++ b/Tests/IntegrationTest.php @@ -27,6 +27,7 @@ use function array_map; use function get_class; +use function method_exists; class IntegrationTest extends TestCase { @@ -455,8 +456,14 @@ public function testRunCommandWithPurgeMode(): void } } -interface ForwardCompatibleEntityManager extends EntityManagerInterface -{ - /** @return mixed */ - public function wrapInTransaction(callable $func); +if (method_exists(EntityManagerInterface::class, 'wrapInTransaction')) { + interface ForwardCompatibleEntityManager extends EntityManagerInterface + { + } +} else { + interface ForwardCompatibleEntityManager extends EntityManagerInterface + { + /** @return mixed */ + public function wrapInTransaction(callable $func); + } } diff --git a/composer.json b/composer.json index e14ad98..672163c 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php": "^7.4 || ^8.0", "doctrine/data-fixtures": "^1.3", "doctrine/doctrine-bundle": "^2.2", - "doctrine/orm": "^2.14.0", + "doctrine/orm": "^2.14.0 || ^3.0", "doctrine/persistence": "^2.4|^3.0", "symfony/config": "^5.4|^6.0|^7.0", "symfony/console": "^5.4|^6.0|^7.0", diff --git a/psalm.xml b/psalm.xml index 4c362d4..148409f 100644 --- a/psalm.xml +++ b/psalm.xml @@ -28,6 +28,7 @@ +