From 2363c43d9815a11657e452625cd64172d5587486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Wed, 15 Jan 2025 12:11:52 +0100 Subject: [PATCH] Relax return type of DoctrineCommand::getEntityManager This is in case project uses custom implementation of entity manager, see https://github.com/doctrine/DoctrineBundle/pull/1855/files/1025d8e36bdd8c92a40f90ae245886f11d3ebc0c#r1916365132 --- src/Command/DoctrineCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Command/DoctrineCommand.php b/src/Command/DoctrineCommand.php index a04f88ad..056e4eda 100644 --- a/src/Command/DoctrineCommand.php +++ b/src/Command/DoctrineCommand.php @@ -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; @@ -51,7 +51,7 @@ protected function getEntityGenerator() * @param string $name * @param int|null $shardId * - * @return EntityManager + * @return EntityManagerInterface */ protected function getEntityManager($name, $shardId = null) { @@ -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; }