summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/hardwareparserlegacy.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-14 14:47:55 +0100
committerSimon Rettberg2023-11-14 14:47:55 +0100
commit06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch)
tree7e5493b102074672d8cfd8fe1a61e49f080edbe8 /modules-available/statistics/inc/hardwareparserlegacy.inc.php
parentUpdate phpstorm config (diff)
downloadslx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip
Add function param/return types, fix a lot more phpstorm complaints
Diffstat (limited to 'modules-available/statistics/inc/hardwareparserlegacy.inc.php')
-rw-r--r--modules-available/statistics/inc/hardwareparserlegacy.inc.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules-available/statistics/inc/hardwareparserlegacy.inc.php b/modules-available/statistics/inc/hardwareparserlegacy.inc.php
index 7ee39bce..a6ac6d5e 100644
--- a/modules-available/statistics/inc/hardwareparserlegacy.inc.php
+++ b/modules-available/statistics/inc/hardwareparserlegacy.inc.php
@@ -243,10 +243,11 @@ class HardwareParserLegacy
$ramOk = true;
}
if ($ramOk && preg_match('/^\s*Number Of Devices:\s+(\d+)\s*$/i', $line, $out)) {
- $row['Memory Slot Count'] += $out[1];
+ $row['Memory Slot Count'] += (int)$out[1];
}
if ($ramOk && preg_match('/^\s*Maximum Capacity:\s+(\d.+)/i', $line, $out)) {
- $row['Memory Maximum Capacity'] += HardwareParser::convertSize($out[1], 'G', false);
+ /** @var array{"Memory Slot Count": int} $row */
+ $row['Memory Maximum Capacity'] += (int)HardwareParser::convertSize($out[1], 'G', false);
}
} elseif ($section === 'Memory Device') {
if (preg_match('/^\s*Size:\s*(.*?)\s*$/i', $line, $out)) {