Total Complexity | 5 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | #[Injectable] |
||
8 | class Shell |
||
9 | { |
||
10 | 1 | public function getDocumentWidthFromOS(): int |
|
11 | { |
||
12 | 1 | $os = (PHP_OS_FAMILY === 'Windows' ? 'Windows' : isset($_SERVER['TERM'])) ? 'Unix' : 'undefined'; |
|
13 | 1 | return match ($os) { |
|
14 | 'Windows' => $this->getDocumentWidthWindows(), |
||
15 | 1 | 'Unix' => $this->getDocumentWidthUnix(), |
|
16 | 1 | default => 80 |
|
17 | }; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @codeCoverageIgnore |
||
22 | */ |
||
23 | private function getDocumentWidthWindows(): int |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @codeCoverageIgnore |
||
31 | */ |
||
32 | private function getDocumentWidthUnix(): int |
||
37 |