ProxyFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%
Metric Value
dl 0
loc 21
wmc 1
lcom 0
cbo 3
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 12 1
1
<?php
2
namespace mxdiModule\Factory;
3
4
use Zend\ServiceManager\FactoryInterface;
5
use Zend\ServiceManager\ServiceLocatorInterface;
6
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
7
use ProxyManager\Configuration;
8
9
class ProxyFactory implements FactoryInterface
10
{
11
    /**
12
     * Create service
13
     *
14
     * @param ServiceLocatorInterface $serviceLocator
15
     * @return Configuration
16
     */
17 1
    public function createService(ServiceLocatorInterface $serviceLocator)
18
    {
19 1
        $config = $serviceLocator->get('config')['mxdimodule'];
20
21 1
        $configuration = new Configuration();
22 1
        $configuration->setProxiesNamespace($config['proxy_namespace']);
23 1
        $configuration->setProxiesTargetDir($config['proxy_dir']);
24
25 1
        spl_autoload_register($configuration->getProxyAutoloader());
26
27 1
        return new LazyLoadingValueHolderFactory($configuration);
28
    }
29
}
30