From 5eb8df7432a708284862e4b126e418265d36b4ab Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 May 2022 18:49:09 +0200 Subject: [inc/Util] Add types, move error printing functions to their own class --- modules-available/statistics/inc/statistics.inc.php | 2 +- modules-available/statistics/inc/statisticsfilter.inc.php | 4 ++-- modules-available/statistics/pages/projectors.inc.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules-available/statistics') diff --git a/modules-available/statistics/inc/statistics.inc.php b/modules-available/statistics/inc/statistics.inc.php index e3eaccc0..d27c1a6a 100644 --- a/modules-available/statistics/inc/statistics.inc.php +++ b/modules-available/statistics/inc/statistics.inc.php @@ -19,7 +19,7 @@ class Statistics } elseif ($returnData === Machine::RAW_DATA) { self::$machineFields['data'] = true; } else { - Util::traceError('Invalid $returnData option passed'); + ErrorHandler::traceError('Invalid $returnData option passed'); } return implode(',', array_keys(self::$machineFields)); } diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index f33c423f..a53ef4d1 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -107,7 +107,7 @@ abstract class StatisticsFilter if (empty($this->ops)) return; if (!in_array($operator, $this->ops)) { - Util::traceError("Invalid op '$operator' for " . get_class($this) . '::' . $this->column); + ErrorHandler::traceError("Invalid op '$operator' for " . get_class($this) . '::' . $this->column); } } @@ -574,7 +574,7 @@ class LocationStatisticsFilter extends EnumStatisticsFilter $operator = str_replace('~', '=', $operator); if ($recursive && is_array($argument)) { - Util::traceError('Cannot use ~ operator for location with array'); + ErrorHandler::traceError('Cannot use ~ operator for location with array'); } if ($recursive) { $argument = array_keys(Location::getRecursiveFlat($argument)); diff --git a/modules-available/statistics/pages/projectors.inc.php b/modules-available/statistics/pages/projectors.inc.php index 91abfe9c..01be2971 100644 --- a/modules-available/statistics/pages/projectors.inc.php +++ b/modules-available/statistics/pages/projectors.inc.php @@ -16,7 +16,7 @@ class SubPage User::assertPermission('hardware.projectors.edit'); $hwid = Request::post('hwid', false, 'int'); if ($hwid === false) { - Util::traceError('Param hwid missing'); + ErrorHandler::traceError('Param hwid missing'); } if ($action === 'addprojector') { Database::exec('INSERT IGNORE INTO statistic_hw_prop (hwid, prop, value)' -- cgit v1.2.3-55-g7522