CacheClearControllerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 11 2
1
<?php
2
namespace mxdiModule\Factory\Controller;
3
4
use mxdiModule\Controller\CacheClearController;
5
use Zend\Cache\Storage\StorageInterface;
6
use Zend\ServiceManager\AbstractPluginManager;
7
use Zend\ServiceManager\FactoryInterface;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
10
class CacheClearControllerFactory implements FactoryInterface
11
{
12
    /**
13
     * @param ServiceLocatorInterface $serviceLocator
14
     * @return CacheClearController
15
     */
16 1
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18 1
        if ($serviceLocator instanceof AbstractPluginManager) {
19 1
            $serviceLocator = $serviceLocator->getServiceLocator();
20 1
        }
21
22
        /** @var StorageInterface $storage */
23 1
        $storage = $serviceLocator->get('mxdiModule\Cache');
24
25 1
        return new CacheClearController($storage);
26
    }
27
}
28