Total Complexity | 7 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 80% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class ShellExec |
||
8 | { |
||
9 | /** @param string[] $output */ |
||
10 | 4 | public function __construct( |
|
11 | private string $command, |
||
12 | private array $output = [], |
||
13 | private int $exitStatus = -1, |
||
14 | private string $lastLine = '' |
||
15 | ) { |
||
16 | } |
||
17 | |||
18 | 4 | public function command(): string |
|
19 | { |
||
20 | 4 | return $this->command; |
|
21 | } |
||
22 | |||
23 | /** @return string[] */ |
||
24 | public function output(): array |
||
25 | { |
||
26 | return $this->output; |
||
27 | } |
||
28 | |||
29 | public function lastLine(): string |
||
30 | { |
||
31 | return $this->lastLine; |
||
32 | } |
||
33 | |||
34 | 4 | public function exitStatus(): int |
|
37 | } |
||
38 | |||
39 | 4 | public function exec(): void |
|
40 | { |
||
41 | 4 | $output = []; |
|
49 | } |
||
50 | |||
51 | 4 | public static function run(string $command): self |
|
58 |