| 1 | <?php |
||
| 7 | class System extends Job |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $command; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $output; |
||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | public function __construct(string $expression, string $command, string $output = null) |
||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | public function getCommand() : string |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string|null |
||
| 38 | */ |
||
| 39 | public function getOutput() |
||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | private function buildCommand() : string |
||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | /** |
||
| 61 | * @return string|null |
||
| 62 | */ |
||
| 63 | public function runInForeground() |
||
| 69 | } |
||
| 70 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: