ProxyClearControllerFactory::createService()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
namespace mxdiModule\Factory\Controller;
3
4
use mxdiModule\Controller\ProxyClearController;
5
use Zend\ServiceManager\AbstractPluginManager;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
class ProxyClearControllerFactory implements FactoryInterface
10
{
11
    /**
12
     * @param ServiceLocatorInterface $serviceLocator
13
     * @return ProxyClearController
14
     */
15 1
    public function createService(ServiceLocatorInterface $serviceLocator)
16
    {
17 1
        if ($serviceLocator instanceof AbstractPluginManager) {
18 1
            $serviceLocator = $serviceLocator->getServiceLocator();
19 1
        }
20
21 1
        return new ProxyClearController($serviceLocator->get('config')['mxdimodule']['proxy_dir']);
22
    }
23
}
24