Skip to content

Commit

Permalink
Relax return type of DoctrineCommand::getEntityManager
Browse files Browse the repository at this point in the history
This is in case project uses custom implementation of entity manager, see https://github.com/doctrine/DoctrineBundle/pull/1855/files/1025d8e36bdd8c92a40f90ae245886f11d3ebc0c#r1916365132
  • Loading branch information
ostrolucky committed Jan 15, 2025
1 parent ab136b4 commit 2363c43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/DoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Doctrine\Bundle\DoctrineBundle\Command;

use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\EntityGenerator;
use Doctrine\Persistence\ManagerRegistry;
use InvalidArgumentException;
Expand Down Expand Up @@ -51,7 +51,7 @@ protected function getEntityGenerator()
* @param string $name
* @param int|null $shardId
*
* @return EntityManager
* @return EntityManagerInterface
*/
protected function getEntityManager($name, $shardId = null)
{
Expand All @@ -61,7 +61,7 @@ protected function getEntityManager($name, $shardId = null)
throw new InvalidArgumentException('Shards are not supported anymore using doctrine/dbal >= 3');
}

assert($manager instanceof EntityManager);
assert($manager instanceof EntityManagerInterface);

return $manager;
}
Expand Down

0 comments on commit 2363c43

Please sign in to comment.