Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
18 | 1 | public static function create(ContainerInterface $container) |
|
19 | { |
||
20 | 1 | $commandToHandlerMap = self::gatherMapping(); |
|
21 | |||
22 | 1 | $containerLocator = new ContainerLocator( |
|
23 | $container, |
||
24 | $commandToHandlerMap |
||
25 | ); |
||
26 | |||
27 | 1 | $commandHandlerMiddleware = new CommandHandlerMiddleware( |
|
28 | 1 | new ClassNameExtractor(), |
|
29 | $containerLocator, |
||
30 | 1 | new HandleInflector() |
|
31 | ); |
||
32 | |||
33 | 1 | return new CommandBus( |
|
34 | 1 | $container->get(LoopInterface::class), |
|
35 | $commandHandlerMiddleware |
||
36 | ); |
||
37 | } |
||
38 | |||
68 |