1 | <?php |
||
13 | final class CommandBus implements \SmoothPhp\Contracts\CommandBus\CommandBus |
||
14 | { |
||
15 | /** |
||
16 | * @var callable |
||
17 | */ |
||
18 | private $middlewareChain; |
||
19 | |||
20 | /** |
||
21 | * CommandBus constructor. |
||
22 | * @param CommandBusMiddleware[] $middleware |
||
23 | */ |
||
24 | 9 | public function __construct(array $middleware) |
|
28 | |||
29 | /** |
||
30 | * @param Command $command |
||
31 | */ |
||
32 | 9 | public function execute(Command $command) |
|
38 | |||
39 | /** |
||
40 | * @param $middleware |
||
41 | * @return \Closure |
||
42 | */ |
||
43 | 9 | private function generateMiddlewareCallChain($middlewareList) |
|
60 | } |
||
61 |