1 | <?php |
||
16 | class PerCommandMiddleware implements Middleware |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | public $commandMiddlewares; // TODO: make private after switching to yiisoft/di |
||
22 | /** |
||
23 | * @var Container |
||
24 | */ |
||
25 | private $di; |
||
26 | |||
27 | public function __construct(Container $di) |
||
31 | |||
32 | /** |
||
33 | * @param $command |
||
34 | * @return CommandBus|null |
||
35 | * @throws InvalidConfigException |
||
36 | * @throws \yii\di\NotInstantiableException |
||
37 | */ |
||
38 | private function getBusForCommand($command): ?CommandBus |
||
62 | |||
63 | /** |
||
64 | * @param object $command |
||
65 | * @param callable $next |
||
66 | * |
||
67 | * @return mixed |
||
68 | */ |
||
69 | public function execute($command, callable $next) |
||
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getCommandMiddlewares(): array |
||
86 | |||
87 | /** |
||
88 | * @param array $commandMiddlewares |
||
89 | */ |
||
90 | public function setCommandMiddlewares(array $commandMiddlewares): void |
||
94 | } |
||
95 |