Skip to content

Commit

Permalink
Add support for doctrine/orm 3 (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Nov 19, 2023
1 parent 3ef4513 commit c808a0c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
15 changes: 11 additions & 4 deletions Tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

use function array_map;
use function get_class;
use function method_exists;

class IntegrationTest extends TestCase
{
Expand Down Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<DuplicateClass>
<errorLevel type="suppress">
<file name="Command/CommandCompatibility.php"/>
<file name="Tests/IntegrationTest.php"/>
</errorLevel>
</DuplicateClass>
</issueHandlers>
Expand Down

0 comments on commit c808a0c

Please sign in to comment.