@@ -58,7 +58,9 @@ discard block |
||
58 | 58 | if ($metric->isApplicable()) { |
59 | 59 | $lastValue = Memory::getInstance()->getLastData($metric->getName(), -1); |
60 | 60 | $currentValue = $metric->getValue($lastValue); |
61 | - if ($currentValue >= 0) Memory::getInstance()->addData($metric->getName(), $currentValue); |
|
61 | + if ($currentValue >= 0) { |
|
62 | + Memory::getInstance()->addData($metric->getName(), $currentValue); |
|
63 | + } |
|
62 | 64 | $metricResults[$metric->getName()] = max(0, $currentValue); |
63 | 65 | } |
64 | 66 | } |
@@ -72,7 +74,9 @@ discard block |
||
72 | 74 | |
73 | 75 | $file = new File(); |
74 | 76 | |
75 | - if (!$file->fileExists('/proc/net/dev')) return 0; |
|
77 | + if (!$file->fileExists('/proc/net/dev')) { |
|
78 | + return 0; |
|
79 | + } |
|
76 | 80 | |
77 | 81 | $lines = $file->getContents('/proc/net/dev', true); |
78 | 82 | foreach ($lines as $line) { |
@@ -85,7 +89,9 @@ discard block |
||
85 | 89 | } |
86 | 90 | } |
87 | 91 | |
88 | - if (!isset($total)) return 0; |
|
92 | + if (!isset($total)) { |
|
93 | + return 0; |
|
94 | + } |
|
89 | 95 | |
90 | 96 | $history = $memory->getData(self::MEMORY_KEY) ?? []; |
91 | 97 |