EntityRepositoryFactoryFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasEntity\Factory\Service;
6
7
use Arp\LaminasEntity\Service\EntityRepositoryFactory;
8
use Arp\LaminasEntity\Service\EntityRepositoryManager;
9
use Arp\LaminasFactory\AbstractFactory;
10
use Doctrine\ORM\Repository\DefaultRepositoryFactory;
11
use Interop\Container\ContainerInterface;
12
13
/**
14
 * @author  Alex Patterson <[email protected]>
15
 * @package Arp\LaminasEntity\Factory\Service
16
 */
17
final class EntityRepositoryFactoryFactory extends AbstractFactory
18
{
19
    /**
20
     * @param ContainerInterface $container
21
     * @param string             $requestedName
22
     * @param array|null         $options
23
     *
24
     * @return EntityRepositoryFactory
25
     */
26
    public function __invoke(
27
        ContainerInterface $container,
28
        $requestedName,
29
        array $options = null
30
    ): EntityRepositoryFactory {
31
        /** @var EntityRepositoryManager $repositoryManager */
32
        $repositoryManager = $this->getService($container, EntityRepositoryManager::class, $requestedName);
33
34
        return new EntityRepositoryFactory($repositoryManager, new DefaultRepositoryFactory());
35
    }
36
}
37