Completed
Pull Request — master (#8)
by
unknown
15:43
created

InMemoryLocatorFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
namespace TacticianModule\Factory;
3
4
use Interop\Container\ContainerInterface;
5
use League\Tactician\Handler\Locator\InMemoryLocator;
6
use Zend\ServiceManager\Factory\FactoryInterface;
7
8
class InMemoryLocatorFactory implements FactoryInterface
9
{
10
    /**
11
     * Create service
12
     *
13
     * @param ContainerInterface $container
14
     * @param string $requestedName
15
     * @param array $options
16 1
     * @return InMemoryLocator
17
     */
18 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
    {
20 1
        $handlerMap = $container->get('config')['tactician']['handler-map'];
21
22
        return new InMemoryLocator($handlerMap);
23
    }
24
}
25