Passed
Branch ops-updates (277b44)
by Björn
05:09
created

SettingsControllerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 3
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 4 1
1
<?php
2
/**
3
 * BB's Zend Framework 2 Components
4
 *
5
 * AdminModule
6
 *
7
 * @package   [MyApplication]
8
 * @package   BB's Zend Framework 2 Components
9
 * @package   AdminModule
10
 * @author    Björn Bartels <[email protected]>
11
 * @link      https://gitlab.bjoernbartels.earth/groups/zf2
12
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
13
 * @copyright copyright (c) 2016 Björn Bartels <[email protected]>
14
 */
15
16
namespace Admin\Factory;
17
18
use Admin\Controller\SettingsController;
19
use Zend\ServiceManager\FactoryInterface;
20
use Zend\ServiceManager\ServiceLocatorInterface;
21
22
class SettingsControllerFactory implements FactoryInterface
23
{
24
    /**
25
     * Create service
26
     *
27
     * @param ServiceLocatorInterface $serviceLocator
28
     *
29
     * @return mixed
30
     */
31
    public function createService(ServiceLocatorInterface $serviceLocator)
32
    {
33
        $realServiceLocator = $serviceLocator->getServiceLocator();
0 ignored issues
show
Bug introduced by
The method getServiceLocator() does not exist on Zend\ServiceManager\ServiceLocatorInterface. It seems like you code against a sub-type of Zend\ServiceManager\ServiceLocatorInterface such as Zend\ServiceManager\AbstractPluginManager. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        /** @scrutinizer ignore-call */ 
34
        $realServiceLocator = $serviceLocator->getServiceLocator();
Loading history...
34
        return new SettingsController($realServiceLocator);
35
    }
36
}