EntityRepositoryManagerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 1

1 Method

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