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 /inc | |
| 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 'inc')
| -rw-r--r-- | inc/database.inc.php | 18 | ||||
| -rw-r--r-- | inc/dictionary.inc.php | 2 | ||||
| -rw-r--r-- | inc/mailer.inc.php | 2 | ||||
| -rw-r--r-- | inc/paginate.inc.php | 2 | ||||
| -rw-r--r-- | inc/property.inc.php | 2 | ||||
| -rw-r--r-- | inc/taskmanager.inc.php | 2 | ||||
| -rw-r--r-- | inc/taskmanagercallback.inc.php | 2 | ||||
| -rw-r--r-- | inc/trigger.inc.php | 2 |
8 files changed, 16 insertions, 16 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php index 278fd8f0..949e6825 100644 --- a/inc/database.inc.php +++ b/inc/database.inc.php @@ -71,7 +71,7 @@ class Database * * @return array|boolean Associative array representing row, or false if no row matches the query */ - public static function queryFirst(string $query, array $args = [], bool $ignoreError = null) + public static function queryFirst(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -86,7 +86,7 @@ class Database * * @return array|bool List of associative arrays representing rows, or false on error */ - public static function queryAll(string $query, array $args = [], bool $ignoreError = null) + public static function queryAll(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -99,7 +99,7 @@ class Database * * @return array|bool List of values representing first column of query */ - public static function queryColumnArray(string $query, array $args = [], bool $ignoreError = null) + public static function queryColumnArray(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -112,7 +112,7 @@ class Database * * @return array|bool Associative array, first column is key, second column is value */ - public static function queryKeyValueList(string $query, array $args = [], bool $ignoreError = null) + public static function queryKeyValueList(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -132,7 +132,7 @@ class Database * * @return array|bool Associative array, first column is key, remaining columns are array values */ - public static function queryGroupList(string $query, array $args = [], bool $ignoreError = null) + public static function queryGroupList(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -147,7 +147,7 @@ class Database * * @return array|bool Associative array, first column is key, remaining columns are array values */ - public static function queryIndexedList(string $query, array $args = [], bool $ignoreError = null) + public static function queryIndexedList(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -164,7 +164,7 @@ class Database * @param ?bool $ignoreError Ignore query errors and just return false * @return int|boolean Number of rows affected, or false on error */ - public static function exec(string $query, array $args = [], bool $ignoreError = null) + public static function exec(string $query, array $args = [], ?bool $ignoreError = null) { $res = self::simpleQuery($query, $args, $ignoreError); if ($res === false) @@ -198,7 +198,7 @@ class Database * * @return \PDOStatement|false The query result object */ - public static function simpleQuery(string $query, array $args = [], bool $ignoreError = null) + public static function simpleQuery(string $query, array $args = [], ?bool $ignoreError = null) { self::init(); if (CONFIG_DEBUG && !isset(self::$explainList[$query]) && preg_match('/^\s*SELECT/i', $query)) { @@ -417,7 +417,7 @@ class Database * @param ?array $additionalValues assoc array containing columnName => value mapping * @return int AUTO_INCREMENT value matching the given unique values entry */ - public static function insertIgnore(string $table, string $aiKey, array $uniqueValues, array $additionalValues = null): int + public static function insertIgnore(string $table, string $aiKey, array $uniqueValues, ?array $additionalValues = null): int { // Sanity checks if (array_key_exists($aiKey, $uniqueValues)) { diff --git a/inc/dictionary.inc.php b/inc/dictionary.inc.php index f95cb384..c1c14e59 100644 --- a/inc/dictionary.inc.php +++ b/inc/dictionary.inc.php @@ -265,7 +265,7 @@ class Dictionary * @param $langCC ?string Language cc to get flag code for - defaults to current language * @return string html code of img tag for language */ - public static function getFlagHtml(bool $caption = false, string $langCC = null): string + public static function getFlagHtml(bool $caption = false, ?string $langCC = null): string { if ($langCC === null) { $langCC = LANG; diff --git a/inc/mailer.inc.php b/inc/mailer.inc.php index bfdcd320..d6aea545 100644 --- a/inc/mailer.inc.php +++ b/inc/mailer.inc.php @@ -21,7 +21,7 @@ class Mailer private $from; // $keys = array('host', 'port', 'ssl', 'senderAddress', 'replyTo', 'username', 'password', 'serverName'); - public function __construct(string $hosturi, bool $startTls, string $from, string $user, string $pass, string $replyTo = null) + public function __construct(string $hosturi, bool $startTls, string $from, string $user, string $pass, ?string $replyTo = null) { $this->from = $from; if (preg_match('/[^<>"\'\s]+@[^<>"\'\s]+/i', $from, $out)) { diff --git a/inc/paginate.inc.php b/inc/paginate.inc.php index 7757228a..806e2f41 100644 --- a/inc/paginate.inc.php +++ b/inc/paginate.inc.php @@ -15,7 +15,7 @@ class Paginate * @param int $perPage - Number of items to show per page * @param ?string $url - URL of current wegpage */ - public function __construct(string $query, int $perPage, string $url = null) + public function __construct(string $query, int $perPage, ?string $url = null) { $this->currentPage = (isset($_GET['page']) ? (int)$_GET['page'] : 0); $this->perPage = $perPage; diff --git a/inc/property.inc.php b/inc/property.inc.php index aaf03254..7c4c694f 100644 --- a/inc/property.inc.php +++ b/inc/property.inc.php @@ -124,7 +124,7 @@ class Property * @return bool whether the entry existed and has been updated */ public static function updateListEntry(string $key, int $subkey, string $value, - int $maxAgeMinutes = 0, string $expectedValue = null): bool + int $maxAgeMinutes = 0, ?string $expectedValue = null): bool { $args = [ 'name' => $key, diff --git a/inc/taskmanager.inc.php b/inc/taskmanager.inc.php index b165e2f3..4a83e496 100644 --- a/inc/taskmanager.inc.php +++ b/inc/taskmanager.inc.php @@ -53,7 +53,7 @@ class Taskmanager * the return value is just true (and you won't know if the task could actually be started) * @return array{id: string, statusCode: string, data: array}|bool struct representing the task status (as a result of submit); false on communication error */ - public static function submit(string $task, array $data = null, bool $async = false) + public static function submit(string $task, ?array $data = null, ?bool $async = false) { self::init(); $seq = (string) mt_rand(); diff --git a/inc/taskmanagercallback.inc.php b/inc/taskmanagercallback.inc.php index 536c899e..c81eaf85 100644 --- a/inc/taskmanagercallback.inc.php +++ b/inc/taskmanagercallback.inc.php @@ -71,7 +71,7 @@ class TaskmanagerCallback * @param array $callback entry from the callback table (cbfunction + taskid + args) * @param ?array $status status of the task as returned by the taskmanager. If NULL it will be queried. */ - public static function handleCallback(array $callback, array $status = NULL): void + public static function handleCallback(array $callback, ?array $status = null): void { if (is_null($status)) $status = Taskmanager::status($callback['taskid']); diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index d0d5d365..4f52ab5f 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -19,7 +19,7 @@ class Trigger * * @return ?string null if launching task failed, task-id otherwise */ - public static function ipxe(string $taskId = null): ?string + public static function ipxe(?string $taskId = null): ?string { static $lastResult = null; if ($lastResult !== null) |
