summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting
diff options
context:
space:
mode:
authorSimon Rettberg2023-06-20 14:24:13 +0200
committerSimon Rettberg2023-06-20 14:24:13 +0200
commit7a535381a472e6013630396509c8ebba1aa39c45 (patch)
tree886ad4148c5341924502f56cfce1a0f96b3abab7 /modules-available/statistics_reporting
parent[minilinux] Stricter check for stage 4 availability (diff)
downloadslx-admin-7a535381a472e6013630396509c8ebba1aa39c45.tar.gz
slx-admin-7a535381a472e6013630396509c8ebba1aa39c45.tar.xz
slx-admin-7a535381a472e6013630396509c8ebba1aa39c45.zip
[statistics_reporting] Fix phpstorm complaints
Diffstat (limited to 'modules-available/statistics_reporting')
-rw-r--r--modules-available/statistics_reporting/inc/remotereport.inc.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules-available/statistics_reporting/inc/remotereport.inc.php b/modules-available/statistics_reporting/inc/remotereport.inc.php
index fdd32f57..7227259a 100644
--- a/modules-available/statistics_reporting/inc/remotereport.inc.php
+++ b/modules-available/statistics_reporting/inc/remotereport.inc.php
@@ -23,19 +23,19 @@ class RemoteReport
*
* @return bool true if reporting is on, false if off
*/
- public static function isReportingEnabled()
+ public static function isReportingEnabled(): bool
{
return Property::get(self::ENABLED_ID, 'on') === 'on';
}
/**
- * Get the timestamp of the end of the next 7 day interval to
+ * Get the timestamp of the end of the next 7-day interval to
* report statistics for. Usually if this is < time() you want
* to generate the report.
*
* @return int timestamp of the end of the reporting time frame
*/
- public static function getReportingTimestamp()
+ public static function getReportingTimestamp(): int
{
$ts = Property::get(self::NEXT_SUBMIT_ID, 0);
if ($ts === 0) {
@@ -52,7 +52,7 @@ class RemoteReport
/**
* Update the timestamp of the next scheduled statistics report.
- * This sets the end of the next 7 day interval to the start of
+ * This sets the end of the next 7-day interval to the start of
* next monday (00:00).
*/
public static function writeNextReportingTimestamp()
@@ -68,7 +68,8 @@ class RemoteReport
* @param int[] $days list of days to generate aggregated stats for
* @return array wrapped up statistics, ready for reporting
*/
- public static function generateReport(int $to, $days = false) {
+ public static function generateReport(int $to, $days = false): array
+ {
$result = array();
if (RemoteReport::isReportingEnabled()) {
if ($days === false) {
@@ -102,7 +103,7 @@ class RemoteReport
return $result;
}
- private static function getLocalHardware()
+ private static function getLocalHardware(): array
{
$cpuInfo = file_get_contents('/proc/cpuinfo');
$uptime = file_get_contents('/proc/uptime');
@@ -139,7 +140,7 @@ class RemoteReport
return $data;
}
- private static function getGpus(int $from, int $to)
+ private static function getGpus(int $from, int $to): array
{
$q = new HardwareQuery(HardwareInfo::PCI_DEVICE, null, true);