diff --git a/lib/OperatingSystems/Dummy.php b/lib/OperatingSystems/Dummy.php index 74ecb250..77cf8b91 100644 --- a/lib/OperatingSystems/Dummy.php +++ b/lib/OperatingSystems/Dummy.php @@ -49,4 +49,8 @@ public function getDiskInfo(): array { public function getThermalZones(): array { return []; } + + public function getCpuCount(): int { + return 1; + } } diff --git a/lib/OperatingSystems/FreeBSD.php b/lib/OperatingSystems/FreeBSD.php index fba96e92..bf1b8153 100644 --- a/lib/OperatingSystems/FreeBSD.php +++ b/lib/OperatingSystems/FreeBSD.php @@ -80,7 +80,8 @@ public function getCpuCount(): int { try { $numCpu = intval($this->executeCommand('sysctl -n hw.ncpu')); //TODO: this should be tested if it actually works on FreeBSD - } catch (RuntimeException) {} + } catch (RuntimeException) { + } return $numCpu; } diff --git a/lib/OperatingSystems/Linux.php b/lib/OperatingSystems/Linux.php index e808f60a..15ed38f8 100644 --- a/lib/OperatingSystems/Linux.php +++ b/lib/OperatingSystems/Linux.php @@ -106,13 +106,13 @@ public function getCpuName(): string { return $data; } - public function getCpuCount(): int - { + public function getCpuCount(): int { $numCpu = 1; // this should be a save default try { $numCpu = intval($this->executeCommand('nproc --all')); - } catch (RuntimeException) {} + } catch (RuntimeException) { + } return $numCpu; }