From 7a535381a472e6013630396509c8ebba1aa39c45 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 20 Jun 2023 14:24:13 +0200 Subject: [statistics_reporting] Fix phpstorm complaints --- .../statistics_reporting/inc/remotereport.inc.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'modules-available/statistics_reporting/inc/remotereport.inc.php') 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); -- cgit v1.2.3-55-g7522