diff --git a/lib/Froxlor/Api/ApiParameter.php b/lib/Froxlor/Api/ApiParameter.php index fdefb549..588579e6 100644 --- a/lib/Froxlor/Api/ApiParameter.php +++ b/lib/Froxlor/Api/ApiParameter.php @@ -44,7 +44,7 @@ abstract class ApiParameter * * @throws Exception */ - public function __construct(array $params = null) + public function __construct(?array $params = null) { if (!is_null($params)) { $params = $this->trimArray($params); @@ -91,7 +91,7 @@ abstract class ApiParameter * @return mixed * @throws Exception */ - protected function getUlParam(string $param = null, string $ul_field = null, bool $optional = false, $default = 0) + protected function getUlParam(?string $param = null, ?string $ul_field = null, bool $optional = false, $default = 0) { $param_value = (int)$this->getParam($param, $optional, $default); $ul_field_value = $this->getBoolParam($ul_field, true, 0); @@ -116,7 +116,7 @@ abstract class ApiParameter * @return mixed * @throws Exception */ - protected function getParam(string $param = null, bool $optional = false, $default = '') + protected function getParam(?string $param = null, bool $optional = false, $default = '') { // does it exist? if (!isset($this->cmd_params[$param])) { @@ -183,7 +183,7 @@ abstract class ApiParameter * * @return string */ - protected function getBoolParam(string $param = null, bool $optional = false, $default = false) + protected function getBoolParam(?string $param = null, bool $optional = false, $default = false) { $_default = '0'; if ($default) { diff --git a/lib/Froxlor/Database/Database.php b/lib/Froxlor/Database/Database.php index 14a5fd4b..2c42fb14 100644 --- a/lib/Froxlor/Database/Database.php +++ b/lib/Froxlor/Database/Database.php @@ -133,7 +133,7 @@ class Database * if set to false, the error will be logged, but we go on * @throws Exception */ - private static function showerror(Exception $error, bool $showerror = true, bool $json_response = false, PDOStatement $stmt = null) + private static function showerror(Exception $error, bool $showerror = true, bool $json_response = false, ?PDOStatement $stmt = null) { global $userinfo, $theme, $linker; diff --git a/lib/Froxlor/FroxlorLogger.php b/lib/Froxlor/FroxlorLogger.php index 5c37bb75..7c29bfea 100644 --- a/lib/Froxlor/FroxlorLogger.php +++ b/lib/Froxlor/FroxlorLogger.php @@ -164,7 +164,7 @@ class FroxlorLogger * @param int $type * @param ?string $text */ - public function logAction($action = FroxlorLogger::USR_ACTION, int $type = LOG_NOTICE, string $text = null) + public function logAction($action = FroxlorLogger::USR_ACTION, int $type = LOG_NOTICE, ?string $text = null) { // not logging normal stuff if not set to "paranoid" logging if (!self::$crondebug_flag && Settings::Get('logger.severity') == '1' && $type > LOG_NOTICE) { diff --git a/lib/Froxlor/PhpHelper.php b/lib/Froxlor/PhpHelper.php index 7470e90d..5bcc157b 100644 --- a/lib/Froxlor/PhpHelper.php +++ b/lib/Froxlor/PhpHelper.php @@ -199,7 +199,7 @@ class PhpHelper * @param string|null $nameserver set additional resolver nameserver to use (e.g. 1.1.1.1) * @return bool|array */ - public static function gethostbynamel6(string $host, bool $try_a = true, string $nameserver = null) + public static function gethostbynamel6(string $host, bool $try_a = true, ?string $nameserver = null) { $ips = []; @@ -442,7 +442,7 @@ class PhpHelper * @param bool $asReturn * @return string */ - public static function parseArrayToPhpFile(array $array, string $comment = null, bool $asReturn = false): string + public static function parseArrayToPhpFile(array $array, ?string $comment = null, bool $asReturn = false): string { $str = sprintf("data['sql_search'])) { $this->data['sql_search'] = [];