PhinxControllerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getZfPhinxService() 0 3 1
A __invoke() 0 4 1
1
<?php
2
3
namespace ZfPhinx\Controller;
4
5
use Interop\Container\ContainerInterface;
6
use ZfPhinx\Service\ZfPhinxService;
7
8
/**
9
 * Phinx controller factory
10
 */
11
class PhinxControllerFactory
12
{
13
    /**
14
     * @param  ContainerInterface $container
15
     * @return PhinxController
16
     */
17 1
    public function __invoke(ContainerInterface $container)
18
    {
19 1
        return new PhinxController(
20 1
            $this->getZfPhinxService($container)
21 1
        );
22
    }
23
24
    /**
25
     * Gets ZF Phinx Service
26
     *
27
     * @param  ContainerInterface $container
28
     * @return ZfPhinxService
29
     */
30 1
    private function getZfPhinxService(ContainerInterface $container)
31
    {
32 1
        return $container->get(ZfPhinxService::class);
33
    }
34
}
35