| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 5 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | final class CommandBus |
||
| 15 | { |
||
| 16 | /** @var Closure(object $command):mixed */ |
||
| 17 | private Closure $middlewareChain; |
||
| 18 | |||
| 19 | 3 | public function __construct(Middleware ...$middleware) |
|
| 22 | 3 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Executes the given command and optionally returns a value |
||
| 26 | * |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | 3 | public function handle(object $command) |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param Middleware[] $middlewareList |
||
| 36 | */ |
||
| 37 | 3 | private function createExecutionChain(array $middlewareList): Closure |
|
| 48 |