Conditions | 5 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | protected function getOperatingSystem(array $options): String |
||
17 | { |
||
18 | if (isset($options["operatingSystem"])) { |
||
19 | return $options["operatingSystem"]; |
||
20 | } |
||
21 | $uname = strtolower(php_uname()); |
||
22 | if (strpos($uname, "darwin") !== false) { |
||
23 | return "osx"; |
||
24 | } elseif (strpos($uname, "win") !== false) { |
||
25 | return "windows"; |
||
26 | } elseif (strpos($uname, "linux") !== false) { |
||
27 | return "linux"; |
||
28 | } |
||
29 | throw new UnknownOperatingSystemException("Unknown operating system {$uname}"); |
||
30 | } |
||
31 | } |
||
32 |