Completed
Push — master ( d322ef...2009cd )
by Baptiste
03:15 queued 01:06
created

ContainerAwareCommandBusFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 12 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\CommandBusBundle\Factory;
5
6
use Innmind\CommandBusBundle\ContainerAwareCommandBus;
7
use Innmind\Immutable\Map;
8
use Symfony\Component\DependencyInjection\ContainerInterface;
9
10
final class ContainerAwareCommandBusFactory
11
{
12 3
    public static function make(
13
        ContainerInterface $container,
14
        array $services
15
    ): ContainerAwareCommandBus {
16 3
        $map = new Map('string', 'string');
17
18 3
        foreach ($services as $class => $service) {
19 3
            $map = $map->put($class, $service);
20
        }
21
22 3
        return new ContainerAwareCommandBus($container, $map);
23
    }
24
}
25