1 | <?php |
||
17 | class DirectBindingCommandHandlerLocator implements CommandHandlerLocator |
||
18 | { |
||
19 | /** |
||
20 | * @var callable[] |
||
21 | */ |
||
22 | private $handlers = []; |
||
23 | |||
24 | /** |
||
25 | * Bind command handler to concrete command by class name. |
||
26 | * |
||
27 | * @param string $command_name |
||
28 | * @param callable $handler |
||
29 | */ |
||
30 | 3 | public function registerHandler(string $command_name, callable $handler): void |
|
34 | |||
35 | /** |
||
36 | * @param CommandSubscriber $subscriber |
||
37 | */ |
||
38 | 1 | public function registerSubscriber(CommandSubscriber $subscriber): void |
|
47 | |||
48 | /** |
||
49 | * @param Command $command |
||
50 | * |
||
51 | * @return callable|null |
||
52 | */ |
||
53 | 3 | public function findHandler(Command $command): ?callable |
|
57 | } |
||
58 |