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

ContainerAwareCommandBusFactory::make()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 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