| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function __invoke(ContainerInterface $container): QueryBus |
||
| 19 | { |
||
| 20 | $config = $container->get('config')['query_bus']; |
||
| 21 | |||
| 22 | $inflector = $container->get($config['inflector']); |
||
| 23 | $locator = $container->get($config['locator']); |
||
| 24 | $nameExtractor = $container->get($config['extractor']); |
||
| 25 | |||
| 26 | $commandHandlerMiddleware = new CommandHandlerMiddleware( |
||
| 27 | $nameExtractor, |
||
| 28 | $locator, |
||
| 29 | $inflector |
||
| 30 | ); |
||
| 31 | |||
| 32 | return new QueryBus(array_merge( |
||
| 33 | array_map(function (string $middleware) use ($container) { |
||
| 34 | return $container->get($middleware); |
||
| 35 | }, $config['middleware']), |
||
| 36 | [$commandHandlerMiddleware] |
||
| 37 | )); |
||
| 40 |