Skip to content

Commit c808a0c

Browse files
authored
Add support for doctrine/orm 3 (#415)
1 parent 3ef4513 commit c808a0c

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-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",

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<DuplicateClass>
2929
<errorLevel type="suppress">
3030
<file name="Command/CommandCompatibility.php"/>
31+
<file name="Tests/IntegrationTest.php"/>
3132
</errorLevel>
3233
</DuplicateClass>
3334
</issueHandlers>

0 commit comments

Comments
 (0)