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

TableFactory::createService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
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