HandlerLocator.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | namespace League\Tactician\Handler\Locator; |
| 4 | |
| 5 | use League\Tactician\Exception\MissingHandlerException; |
| 6 | |
| 7 | /** |
| 8 | * Service locator for handler objects |
| 9 | * |
| 10 | * This interface is often a wrapper around your frameworks dependency |
| 11 | * injection container or just maps command names to handler names on disk somehow. |
| 12 | */ |
| 13 | interface HandlerLocator |
| 14 | { |
| 15 | /** |
| 16 | * Retrieves the handler for a specified command |
| 17 | * |
| 18 | * @param string $commandName |
| 19 | * |
| 20 | * @return object |
| 21 | * |
| 22 | * @throws MissingHandlerException |
| 23 | */ |
| 24 | public function getHandlerForCommand($commandName); |
| 25 | } |
| 26 |