diff options
author | Simon Rettberg | 2023-11-02 19:08:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2023-11-02 19:08:58 +0100 |
commit | c2d95ffaeaa289752b4c7b6664b6ca112a02e350 (patch) | |
tree | 2c29b0157d14198aadbdbc9f8c18ded0bd4dadcd /inc | |
parent | [rebootcontrol] Remove API prototype (diff) | |
download | slx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.tar.gz slx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.tar.xz slx-admin-c2d95ffaeaa289752b4c7b6664b6ca112a02e350.zip |
Roundup of issues reported by PHPStorm
Mostly redundant checks, logic errors, dead code, etc.
Diffstat (limited to 'inc')
-rw-r--r-- | inc/event.inc.php | 2 | ||||
-rw-r--r-- | inc/module.inc.php | 2 | ||||
-rw-r--r-- | inc/request.inc.php | 2 | ||||
-rw-r--r-- | inc/taskmanagercallback.inc.php | 1 |
4 files changed, 3 insertions, 4 deletions
diff --git a/inc/event.inc.php b/inc/event.inc.php index 57b4871e..e622f74f 100644 --- a/inc/event.inc.php +++ b/inc/event.inc.php @@ -64,7 +64,7 @@ class Event } else { $res = Taskmanager::waitComplete($ipxeId, 5000); if (Taskmanager::isFailed($res)) { - EventLog::failure('Update PXE Menu failed', $res['data']['error'] ?? $res['data']['error'] ?? ''); + EventLog::failure('Update PXE Menu failed', $res['data']['error'] ?? $res['statusCode'] ?? ''); $everythingFine = false; } } diff --git a/inc/module.inc.php b/inc/module.inc.php index ea3af1ba..042ea0c0 100644 --- a/inc/module.inc.php +++ b/inc/module.inc.php @@ -173,7 +173,7 @@ class Module if (isset($json['category']) && is_string($json['category'])) { $this->category = $json['category']; } - $this->collapse = isset($json['collapse']) && (bool)$json['collapse']; + $this->collapse = isset($json['collapse']) && $json['collapse']; if (isset($json['client-plugin'])) { $this->clientPlugin = (bool)$json['client-plugin']; } diff --git a/inc/request.inc.php b/inc/request.inc.php index bdbd32d5..7cf4a73f 100644 --- a/inc/request.inc.php +++ b/inc/request.inc.php @@ -75,7 +75,7 @@ class Request } return $default; } - if ($default === self::REQUIRED && is_string($array[$key]) && $array[$key] === '') { + if ($default === self::REQUIRED && $array[$key] === '') { Message::addError('main.parameter-empty', $key); Util::redirect('?do=' . $_REQUEST['do']); } diff --git a/inc/taskmanagercallback.inc.php b/inc/taskmanagercallback.inc.php index 84754de0..7c1e965e 100644 --- a/inc/taskmanagercallback.inc.php +++ b/inc/taskmanagercallback.inc.php @@ -180,7 +180,6 @@ class TaskmanagerCallback unset($data['storetype']); Property::setVmStoreConfig($data); } - return; } } |