Completed
Push — develop ( d322ef...d5777f )
by Baptiste
07:26
created

ContainerAwareCommandBusFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 15
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
    public static function make(
13
        ContainerInterface $container,
14
        array $services
15
    ): ContainerAwareCommandBus {
16
        $map = new Map('string', 'string');
17
18
        foreach ($services as $class => $service) {
19
            $map = $map->put($class, $service);
20
        }
21
22
        return new ContainerAwareCommandBus($container, $map);
23
    }
24
}
25