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

SystemControllerFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
namespace Application\Factory;
3
4
use Application\Controller\SystemController;
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
8
class SystemControllerFactory implements FactoryInterface
9
{
10
    /**
11
     * Create service
12
     *
13
     * @param ServiceLocatorInterface $serviceLocator
14
     *
15
     * @return mixed
16
     */
17
    public function createService(ServiceLocatorInterface $serviceLocator)
18
    {
19
        $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

19
        /** @scrutinizer ignore-call */ 
20
        $realServiceLocator = $serviceLocator->getServiceLocator();
Loading history...
20
        return new SystemController($realServiceLocator);
21
    }
22
}