ProxyDriverFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 1
A createService() 0 4 1
1
<?php
2
3
namespace Fabiang\DoctrineDynamic\Service;
4
5
use Fabiang\DoctrineDynamic\ProxyDriver;
6
use Fabiang\DoctrineDynamic\Configuration;
7
use Fabiang\DoctrineDynamic\ProxyDriverFactory as BaseProxyDriverFactory;
8
use Doctrine\ORM\EntityManager;
9
use Interop\Container\ContainerInterface;
10
use Zend\ServiceManager\FactoryInterface;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
13
final class ProxyDriverFactory extends BaseProxyDriverFactory implements
14
    FactoryInterface
15
{
16
    /**
17
     * @param ContainerInterface $container
18
     * @param string $requestedName
19
     * @param array $options
20
     * @return ProxyDriver[]
21
     */
22 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
23
    {
24 1
        $entityManager = $container->get(EntityManager::class);
25 1
        $configuration = $container->get(Configuration::class);
26 1
        return $this->factory($entityManager, $configuration);
27
    }
28
29
    /**
30
     * @param ServiceLocatorInterface $serviceLocator
31
     * @return ProxyDriver
32
     */
33 1
    public function createService(ServiceLocatorInterface $serviceLocator)
34
    {
35 1
        return $this($serviceLocator, ProxyDriver::class);
36
    }
37
}
38