]> Raphaël G. Git Repositories - userbundle/commitdiff
Match doctrine prototype
authorRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:31:16 +0000 (16:31 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 15:31:16 +0000 (16:31 +0100)
Factory.php

index 3a8702a9e00c21e5075ef71bd9c9da439549806d..c437dc2f7a2c945cbf36df595bdaf4a332d2a1d9 100644 (file)
@@ -13,7 +13,7 @@ namespace Rapsys\UserBundle;
 
 use Doctrine\ORM\EntityManagerInterface;
 use Doctrine\ORM\Repository\RepositoryFactory as RepositoryFactoryInterface;
-use Doctrine\Persistence\ObjectRepository;
+use Doctrine\ORM\EntityRepository;
 
 use Psr\Container\ContainerInterface;
 
@@ -48,7 +48,7 @@ class Factory implements RepositoryFactoryInterface {
        /**
         * {@inheritdoc}
         */
-       public function getRepository(EntityManagerInterface $entityManager, mixed $entityName): ObjectRepository {
+       public function getRepository(EntityManagerInterface $entityManager, mixed $entityName): EntityRepository {
                //Set repository hash
                $repositoryHash = $entityManager->getClassMetadata($entityName)->getName() . spl_object_hash($entityManager);
 
@@ -68,7 +68,7 @@ class Factory implements RepositoryFactoryInterface {
         * @param EntityManagerInterface $entityManager The EntityManager instance.
         * @param string $entityName The name of the entity.
         */
-       protected function createRepository(EntityManagerInterface $entityManager, string $entityName): ObjectRepository {
+       protected function createRepository(EntityManagerInterface $entityManager, string $entityName): EntityRepository {
                //Get class metadata
                $metadata = $entityManager->getClassMetadata($entityName);