| 1 | <?php |
||
| 9 | class CommandLocatorStrategy implements StrategyInterface |
||
| 10 | { |
||
| 11 | /** @type array The list of commands to try locating. */ |
||
| 12 | private $_commands; |
||
| 13 | |||
| 14 | /** @type \Nubs\Which\Locator The command locator. */ |
||
| 15 | private $_commandLocator; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Initialize the strategy to locate a suitable command from a list. |
||
| 19 | * |
||
| 20 | * @param string[] $commands A list of commands to look for. |
||
| 21 | * @param \Nubs\Which\Locator The command locator. |
||
| 22 | */ |
||
| 23 | public function __construct(array $commands, CommandLocator $commandLocator) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Returns the path to the first command found in the list. |
||
| 31 | * |
||
| 32 | * @return string|null The located command, or null if none could be found. |
||
| 33 | */ |
||
| 34 | public function get() |
||
| 45 | } |
||
| 46 |