wip (#1313)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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("<?php\n// %s\n\n", $comment ?? 'autogenerated froxlor file');
|
||||
|
||||
@@ -464,7 +464,7 @@ class PhpHelper
|
||||
* @param int $depth
|
||||
* @return string
|
||||
*/
|
||||
public static function parseArrayToString(array $array, string $key = null, int $depth = 1): string
|
||||
public static function parseArrayToString(array $array, ?string $key = null, int $depth = 1): string
|
||||
{
|
||||
$str = '';
|
||||
if (!is_null($key)) {
|
||||
|
||||
@@ -162,7 +162,7 @@ class Pagination
|
||||
*
|
||||
* @return Pagination
|
||||
*/
|
||||
public function addSearch(string $searchtext = null, string $field = null, string $operator = null): Pagination
|
||||
public function addSearch(?string $searchtext = null, string $field = null, string $operator = null): Pagination
|
||||
{
|
||||
if (!isset($this->data['sql_search'])) {
|
||||
$this->data['sql_search'] = [];
|
||||
|
||||
Reference in New Issue
Block a user