| Total Complexity | 9 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Runner |
||
| 9 | { |
||
| 10 | private bool $timeout; |
||
| 11 | |||
| 12 | private static ?Runner $instance = null; |
||
| 13 | |||
| 14 | static public function getInstance(): Runner |
||
| 21 | } |
||
| 22 | |||
| 23 | public function __construct() |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | public function run($command, $killAfterSeconds = 5): Process |
||
| 46 | } |
||
| 47 | |||
| 48 | public function commandExists(string $command): bool |
||
| 49 | { |
||
| 50 | $which = $this->run('which ' . $command)->getOutput(); |
||
| 51 | if (empty($which)) { |
||
| 52 | return false; |
||
| 53 | } |
||
| 54 | |||
| 55 | return true; |
||
| 56 | } |
||
| 57 | |||
| 58 | public static function outputToArray(string $output): array |
||
| 61 | } |
||
| 62 | } |