| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function createConfiguredCommandBus(): Interfaces\CommandBus |
||
| 29 | { |
||
| 30 | $commandLogger = new Middleware\CommandLogger(); |
||
| 31 | $commandLogger->setLogger($this->getTestLogger()); |
||
| 32 | |||
| 33 | $container = new Stubs\Container([ |
||
| 34 | Stubs\Commands\PublishDraft::class => new Stubs\Handlers\PublishDraft(), |
||
| 35 | ]); |
||
| 36 | |||
| 37 | $resolver = Resolver::create($container); |
||
| 38 | $lazyFn = function (): Interfaces\Handler { |
||
| 39 | return new Stubs\Handlers\ReserveRoom(); |
||
| 40 | }; |
||
| 41 | |||
| 42 | $resolver->pushHandlerDeferred(Stubs\Commands\ReserveRoom::class, $lazyFn); |
||
| 43 | |||
| 44 | return CommandBus::create($resolver) |
||
| 45 | ->pushMiddleware($commandLogger); |
||
| 46 | } |
||
| 48 |