| 1 | <?php |
||
| 11 | class HandlerLocator implements \League\Tactician\Handler\Locator\HandlerLocator |
||
| 12 | { |
||
| 13 | |||
| 14 | protected $container; |
||
| 15 | |||
| 16 | protected $handlers = []; |
||
| 17 | |||
| 18 | 9 | public function __construct(ContainerInterface $container) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * Retrieves the handler for a specified command |
||
| 25 | * |
||
| 26 | * @param string $commandName |
||
| 27 | * @return object |
||
| 28 | * @throws MissingHandlerException |
||
| 29 | */ |
||
| 30 | 9 | public function getHandlerForCommand($commandName) |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Add a handler for a command |
||
| 44 | * |
||
| 45 | * @param string $command |
||
| 46 | * @param string $handler |
||
| 47 | */ |
||
| 48 | 6 | public function pushHandler($command, $handler) |
|
| 52 | } |
||
| 53 |