PhinxControllerFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

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 3
cts 3
cp 1
crap 1
rs 10
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