ConsoleControllerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 11 1
1
<?php
2
3
namespace ZfSnapGeoip\Controller;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
8
/**
9
 * Factory of ConsoleController
10
 *
11
 * @author Witold Wasiczko <[email protected]>
12
 */
13
class ConsoleControllerFactory implements FactoryInterface
0 ignored issues
show
Bug introduced by
There is one abstract method __invoke in this class; you could implement it, or declare this class as abstract.
Loading history...
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
14
{
15
16
    public function createService(ServiceLocatorInterface $serviceLocator)
17
    {
18
        /* @var $serviceLocator \Zend\Mvc\Controller\ControllerManager */
19
        $sm = $serviceLocator->getServiceLocator();
0 ignored issues
show
Deprecated Code introduced by
The method Zend\ServiceManager\Serv...er::getServiceLocator() has been deprecated with message: since 3.0.0. Factories using 3.0 should use the container instance passed to the factory instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
20
21
        $console = $sm->get('Console');
22
        $config = $sm->get('ZfSnapGeoip\DatabaseConfig');
23
        $httpClient = $sm->get('ZfSnapGeoip\HttpClient');
24
25
        return new ConsoleController($console, $config, $httpClient);
26
    }
27
28
}
29