Completed
Push — master ( 8482f5...6f4e0b )
by max
02:05
created

TableFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 10 2
1
<?php
2
3
namespace T4web\Migrations\Version;
4
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use Zend\ServiceManager\AbstractPluginManager;
8
9
class TableFactory implements FactoryInterface
10
{
11
12
    /**
13
     * Create service
14
     *
15
     * @param ServiceLocatorInterface $serviceLocator
16
     * @return mixed
17
     */
18
    public function createService(ServiceLocatorInterface $serviceLocator)
19
    {
20
        if ($serviceLocator instanceof AbstractPluginManager) {
21
            $serviceLocator = $serviceLocator->getServiceLocator();
22
        }
23
24
        $tableGateway = $serviceLocator->get('T4web\Migrations\Version\TableGateway');
25
26
        return new Table($tableGateway);
27
    }
28
}
29