1 | <?php |
||
16 | class ContainerCommandHandlerLocator implements CommandHandlerLocator |
||
17 | { |
||
18 | /** |
||
19 | * @var ContainerInterface |
||
20 | */ |
||
21 | private $container; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $command_handler_ids = []; |
||
27 | |||
28 | /** |
||
29 | * @param ContainerInterface $container |
||
30 | */ |
||
31 | 4 | public function __construct(ContainerInterface $container) |
|
35 | |||
36 | /** |
||
37 | * @param Command $command |
||
38 | * |
||
39 | * @return callable|null |
||
40 | */ |
||
41 | 4 | public function findHandler(Command $command) |
|
45 | |||
46 | /** |
||
47 | * @param string $command_name |
||
48 | * @param string $service |
||
49 | * @param string $method |
||
50 | */ |
||
51 | 4 | public function registerService($command_name, $service, $method = '__invoke') |
|
55 | |||
56 | /** |
||
57 | * @param string $command_name |
||
58 | * |
||
59 | * @return callable|null |
||
60 | */ |
||
61 | 4 | private function lazyLoad($command_name) |
|
71 | |||
72 | /** |
||
73 | * @param mixed $service |
||
74 | * @param string $method |
||
75 | * |
||
76 | * @return callable|null |
||
77 | */ |
||
78 | 4 | private function resolve($service, $method) |
|
90 | } |
||
91 |