From 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Nov 2023 14:47:55 +0100 Subject: Add function param/return types, fix a lot more phpstorm complaints --- modules-available/statistics/inc/hardwareparserlegacy.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules-available/statistics/inc/hardwareparserlegacy.inc.php') 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)) { -- cgit v1.2.3-55-g7522