Skip to content

Commit a621b25

Browse files
committed
Add support for doctrine/orm 3
1 parent 2191922 commit a621b25

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Tests/IntegrationTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
use function array_map;
2929
use function get_class;
30+
use function method_exists;
3031

3132
class IntegrationTest extends TestCase
3233
{
@@ -455,8 +456,14 @@ public function testRunCommandWithPurgeMode(): void
455456
}
456457
}
457458

458-
interface ForwardCompatibleEntityManager extends EntityManagerInterface
459-
{
460-
/** @return mixed */
461-
public function wrapInTransaction(callable $func);
459+
if (method_exists(EntityManagerInterface::class, 'wrapInTransaction')) {
460+
interface ForwardCompatibleEntityManager extends EntityManagerInterface
461+
{
462+
}
463+
} else {
464+
interface ForwardCompatibleEntityManager extends EntityManagerInterface
465+
{
466+
/** @return mixed */
467+
public function wrapInTransaction(callable $func);
468+
}
462469
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php": "^7.4 || ^8.0",
2424
"doctrine/data-fixtures": "^1.3",
2525
"doctrine/doctrine-bundle": "^2.2",
26-
"doctrine/orm": "^2.14.0",
26+
"doctrine/orm": "^2.14.0 || ^3.0",
2727
"doctrine/persistence": "^2.4|^3.0",
2828
"symfony/config": "^5.4|^6.0|^7.0",
2929
"symfony/console": "^5.4|^6.0|^7.0",

0 commit comments

Comments
 (0)