1 | <?php |
||
14 | class CommandHandlerMiddleware implements Middleware |
||
15 | { |
||
16 | /** |
||
17 | * @var CommandNameExtractor |
||
18 | */ |
||
19 | private $commandNameExtractor; |
||
20 | |||
21 | /** |
||
22 | * @var HandlerLocator |
||
23 | */ |
||
24 | private $handlerLocator; |
||
25 | |||
26 | /** |
||
27 | * @var MethodNameInflector |
||
28 | */ |
||
29 | private $methodNameInflector; |
||
30 | |||
31 | /** |
||
32 | * @param CommandNameExtractor $commandNameExtractor |
||
33 | * @param HandlerLocator $handlerLocator |
||
34 | * @param MethodNameInflector $methodNameInflector |
||
35 | */ |
||
36 | 6 | public function __construct( |
|
45 | |||
46 | /** |
||
47 | * Executes a command and optionally returns a value |
||
48 | * |
||
49 | * @param object $command |
||
50 | * @param callable $next |
||
51 | * |
||
52 | * @return mixed |
||
53 | * |
||
54 | * @throws CanNotInvokeHandlerException |
||
55 | */ |
||
56 | 5 | public function execute($command, callable $next) |
|
73 | } |
||
74 |