From 9aee110cc225184219590cee7051e22f6e6b2e13 Mon Sep 17 00:00:00 2001 From: Mikel Date: Thu, 29 Dec 2022 10:25:43 +0100 Subject: [PATCH] replace references EntityManager by EntityManagerInterface --- Application/Service/DataGateway.php | 12 +++--------- Application/Service/EntityTools.php | 4 ++-- Application/Service/QueryBuilderFactory.php | 6 +++--- .../Application/DoctrineForeignKeyTransformer.php | 6 +++--- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Application/Service/DataGateway.php b/Application/Service/DataGateway.php index 5fa6672..07b585e 100755 --- a/Application/Service/DataGateway.php +++ b/Application/Service/DataGateway.php @@ -2,7 +2,7 @@ namespace Ivoz\Core\Application\Service; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Ivoz\Core\Application\DataTransferObjectInterface; use Ivoz\Core\Application\Event\CommandWasExecuted; use Ivoz\Core\Application\RequestId; @@ -18,7 +18,7 @@ class DataGateway { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; @@ -54,15 +54,9 @@ class DataGateway /** * DataGateway constructor. - * @param EntityManager $entityManager - * @param QueryBuilderFactory $queryBuilderFactory - * @param DoctrineEntityPersister $entityPersister - * @param DtoAssembler $dtoAssembler - * @param DomainEventPublisher $eventPublisher - * @param RequestId $requestId */ public function __construct( - EntityManager $entityManager, + EntityManagerInterface $entityManager, QueryBuilderFactory $queryBuilderFactory, DoctrineEntityPersister $entityPersister, DtoAssembler $dtoAssembler, diff --git a/Application/Service/EntityTools.php b/Application/Service/EntityTools.php index 4cfb8db..45b942a 100644 --- a/Application/Service/EntityTools.php +++ b/Application/Service/EntityTools.php @@ -3,7 +3,7 @@ namespace Ivoz\Core\Application\Service; use Doctrine\DBAL\LockMode; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\PessimisticLockException; use Ivoz\Core\Application\DataTransferObjectInterface; @@ -25,7 +25,7 @@ class EntityTools private $entityUpdater; public function __construct( - EntityManager $entityManager, + EntityManagerInterface $entityManager, EntityPersisterInterface $entityPersister, DtoAssembler $dtoAssembler, CreateEntityFromDto $createEntityFromDto, diff --git a/Application/Service/QueryBuilderFactory.php b/Application/Service/QueryBuilderFactory.php index b3ab753..b7cd064 100644 --- a/Application/Service/QueryBuilderFactory.php +++ b/Application/Service/QueryBuilderFactory.php @@ -2,17 +2,17 @@ namespace Ivoz\Core\Application\Service; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; class QueryBuilderFactory { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; - public function __construct(EntityManager $entityManager) + public function __construct(EntityManagerInterface $entityManager) { $this->em = $entityManager; } diff --git a/Infrastructure/Application/DoctrineForeignKeyTransformer.php b/Infrastructure/Application/DoctrineForeignKeyTransformer.php index 701965b..06d9d90 100755 --- a/Infrastructure/Application/DoctrineForeignKeyTransformer.php +++ b/Infrastructure/Application/DoctrineForeignKeyTransformer.php @@ -3,7 +3,7 @@ namespace Ivoz\Core\Infrastructure\Application; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Ivoz\Core\Application\DataTransferObjectInterface; use Ivoz\Core\Application\ForeignKeyTransformerInterface; use Ivoz\Core\Application\Helper\EntityClassHelper; @@ -12,11 +12,11 @@ class DoctrineForeignKeyTransformer implements ForeignKeyTransformerInterface { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; }