lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php
private function createRepository(EntityManagerInterface $entityManager, $entityName)
    {
        /** @var ClassMetadata $metadata */
        $metadata            = $entityManager->getClassMetadata($entityName);
        $repositoryClassName = $metadata->getCustomRepositoryClassName()
            ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();

        return new $repositoryClassName($entityManager, $metadata);
    }
private function createRepository(EntityManagerInterface $entityManager, $entityName)
    {
        /** @var ClassMetadata $metadata */
        $metadata            = $entityManager->getClassMetadata($entityName);
        $repositoryClassName = $metadata->getCustomRepositoryClassName()
            ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();

        return new $repositoryClassName($entityManager, $metadata);
    }
private function createRepository ( EntityManagerInterface $ entityManager , $ entityName ) { /** @var ClassMetadata $metadata */ $ metadata = $ entityManager -> getClassMetadata ( $ entityName ) ; $ repositoryClassName = $ metadata -> getCustomRepositoryClassName ( ) ? : $ entityManager -> getConfiguration ( ) -> getDefaultRepositoryClassName ( ) ; return new $ repositoryClassName ( $ entityManager , $ metadata ) ; }
Create a new repository instance for an entity class.

@param EntityManagerInterface $entityManager The EntityManager instance.
@param string                 $entityName    The name of the entity.

@return ObjectRepository
Create a new repository instance for an entity class .