diff options
author | Simon Rettberg | 2023-11-15 17:53:47 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-15 17:53:47 +0100 |
commit | aa49154e5a9ee135c3f0286ddda8a01a5290b1ed (patch) | |
tree | 0397403f11a8a890ee11458ea0b1887796480115 /modules-available/statistics/inc | |
parent | idea: Always inspect as if strict_types is enabled (diff) | |
download | slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.tar.gz slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.tar.xz slx-admin-aa49154e5a9ee135c3f0286ddda8a01a5290b1ed.zip |
Fix more type errors, stricter typing
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/statistics.inc.php | 4 | ||||
-rw-r--r-- | modules-available/statistics/inc/statisticshooks.inc.php | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/modules-available/statistics/inc/statistics.inc.php b/modules-available/statistics/inc/statistics.inc.php index 2a9ca3c9..c12f5be4 100644 --- a/modules-available/statistics/inc/statistics.inc.php +++ b/modules-available/statistics/inc/statistics.inc.php @@ -46,11 +46,11 @@ class Statistics * @param string $sort something like 'lastseen ASC' - not sanitized, don't pass user input! * @return Machine[] list of matches */ - public static function getMachinesByIp(string $ip, int $returnData, bool $sort = false): array + public static function getMachinesByIp(string $ip, int $returnData, string $sort = null): array { $fields = self::initFields($returnData); - if ($sort === false) { + if ($sort === null) { $sort = ''; } else { $sort = "ORDER BY $sort"; diff --git a/modules-available/statistics/inc/statisticshooks.inc.php b/modules-available/statistics/inc/statisticshooks.inc.php index b17cf4a9..405ed5f7 100644 --- a/modules-available/statistics/inc/statisticshooks.inc.php +++ b/modules-available/statistics/inc/statisticshooks.inc.php @@ -13,7 +13,11 @@ class StatisticsHooks ['machineuuid' => $machineuuid]); } - public static function getBaseconfigName(string $machineuuid): string + /** + * Hook for baseconfig. + * @return false|string Client name, or false if invalid + */ + public static function getBaseconfigName(string $machineuuid) { self::getRow($machineuuid); if (self::$row === false) @@ -21,6 +25,9 @@ class StatisticsHooks return self::$row['hostname'] ?: self::$row['clientip']; } + /** + * Hook for baseconfig. + */ public static function baseconfigLocationResolver(string $machineuuid): int { self::getRow($machineuuid); |