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

TacticianCommandBusPluginFactory::createService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 4
Bugs 0 Features 0
Metric Value
c 4
b 0
f 0
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
crap 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A TacticianCommandBusPluginFactory::__invoke() 0 6 1
1
<?php
2
namespace TacticianModule\Factory\Controller\Plugin;
3
4
use Interop\Container\ContainerInterface;
5
use League\Tactician\CommandBus;
6
use TacticianModule\Controller\Plugin\TacticianCommandBusPlugin;
7
use Zend\ServiceManager\Factory\FactoryInterface;
8
use Zend\ServiceManager\AbstractPluginManager;
9
10
class TacticianCommandBusPluginFactory implements FactoryInterface
11
{
12
    /**
13
     * Create service
14
     *
15
     * @param ContainerInterface $pm
16
     * @param string $requestedName
17
     * @param array $options
18 2
     * @return TacticianCommandBusPlugin
19
     */
20 2
    public function __invoke(ContainerInterface $pm, $requestedName, array $options = null)
21
    {
22 1
        $commandBus = $pm->get(CommandBus::class);
23 1
24
        return new TacticianCommandBusPlugin($commandBus);
25 1
    }
26
}
27