diff options
| author | Simon Rettberg | 2025-08-01 13:41:49 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2025-08-01 13:41:49 +0200 |
| commit | 429cfb1677ec77c5a945f655d9405d038d3e5a2c (patch) | |
| tree | b3fbb729cb2231f4163b96a67046ad878f48d1b4 /modules-available/statistics | |
| parent | [minilinux] show -> action for POST actions (diff) | |
| download | slx-admin-429cfb1677ec77c5a945f655d9405d038d3e5a2c.tar.gz slx-admin-429cfb1677ec77c5a945f655d9405d038d3e5a2c.tar.xz slx-admin-429cfb1677ec77c5a945f655d9405d038d3e5a2c.zip | |
Implicitly nullable types are deprecated in PHP 8.3, make explicit
Diffstat (limited to 'modules-available/statistics')
4 files changed, 6 insertions, 6 deletions
diff --git a/modules-available/statistics/inc/hardwarequery.inc.php b/modules-available/statistics/inc/hardwarequery.inc.php index 6b1b5043..74beaab8 100644 --- a/modules-available/statistics/inc/hardwarequery.inc.php +++ b/modules-available/statistics/inc/hardwarequery.inc.php @@ -13,7 +13,7 @@ class HardwareQuery * @param string $type hardware type form HardwareInfo * @param ?string $uuid If set, only return data for specific client */ - public function __construct(string $type, string $uuid = null, $connectedOnly = true) + public function __construct(string $type, ?string $uuid = null, bool $connectedOnly = true) { if ($connectedOnly) { $this->joins['mxhw_join'] = "INNER JOIN machine_x_hw mxhw ON (mxhw.hwid = shw.hwid AND mxhw.disconnecttime = 0)"; @@ -97,7 +97,7 @@ class HardwareQuery return $this->addColumn(false, $prop); } - public function addColumn(bool $global, string $prop, string $alias = null): HardwareQueryColumn + public function addColumn(bool $global, string $prop, ?string $alias = null): HardwareQueryColumn { return $this->columns[] = new HardwareQueryColumn($global, $prop, $alias); } diff --git a/modules-available/statistics/inc/hardwarequerycolumn.inc.php b/modules-available/statistics/inc/hardwarequerycolumn.inc.php index 01e32978..b0e60e5b 100644 --- a/modules-available/statistics/inc/hardwarequerycolumn.inc.php +++ b/modules-available/statistics/inc/hardwarequerycolumn.inc.php @@ -18,7 +18,7 @@ class HardwareQueryColumn return 't' . ++self::$id; } - public function __construct(bool $global, string $column, string $alias = null) + public function __construct(bool $global, string $column, ?string $alias = null) { $this->classId = ++self::$id; $this->global = $global; @@ -32,7 +32,7 @@ class HardwareQueryColumn * from HardwareQuery::buildQuery(). * @param string[] $groupConcat if column name is NOT in this array, add as distinct GROUP_CONCAT to column. */ - public function generate(array &$joins, array &$columns, array &$params, array $groupConcat = [], string $globalSrcTableAlias = null) + public function generate(array &$joins, array &$columns, array &$params, array $groupConcat = [], ?string $globalSrcTableAlias = null) { if ($this->global) { $srcTable = $globalSrcTableAlias ?? 'shw'; diff --git a/modules-available/statistics/inc/statistics.inc.php b/modules-available/statistics/inc/statistics.inc.php index c12f5be4..6515feb0 100644 --- a/modules-available/statistics/inc/statistics.inc.php +++ b/modules-available/statistics/inc/statistics.inc.php @@ -46,7 +46,7 @@ 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, string $sort = null): array + public static function getMachinesByIp(string $ip, int $returnData, ?string $sort = null): array { $fields = self::initFields($returnData); diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index 72b0cbf9..23b53471 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -68,7 +68,7 @@ abstract class StatisticsFilter * The HardwareQuery class should probably be extended/rewritten to be more versatile in * this regard. */ - public static function addHardwareJoin(array &$args, array &$joins, string $hwtype = null): string + public static function addHardwareJoin(array &$args, array &$joins, ?string $hwtype = null): string { $joins['mxhw'] = ' INNER JOIN machine_x_hw mxhw ON (mxhw.disconnecttime = 0 AND mxhw.machineuuid = m.machineuuid)'; $key = self::getNewKey('foo'); |
