| 1 | <?php |
||
| 9 | class EnvironmentVariableStrategy implements StrategyInterface |
||
| 10 | { |
||
| 11 | /** @type string The environment variable name. */ |
||
| 12 | private $_name; |
||
| 13 | |||
| 14 | /** @type \Habitat\Environment\Environment The environment wrapper. */ |
||
| 15 | private $_environment; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Initialize the strategy that checks an environment variable for a |
||
| 19 | * command. |
||
| 20 | * |
||
| 21 | * @param string $name The environment variable name to lookup. |
||
| 22 | * @param \Habitat\Environment\Environment $environment The environment |
||
| 23 | * variable wrapper. Defaults to null which just uses PHP's built-in |
||
| 24 | * getenv. |
||
| 25 | */ |
||
| 26 | public function __construct($name, Environment $environment = null) |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Returns the command as found in the environment variable. |
||
| 34 | * |
||
| 35 | * @return string|null The command, or null if the environment variable |
||
| 36 | * wasn't set. |
||
| 37 | */ |
||
| 38 | public function get() |
||
| 44 | } |
||
| 45 |