mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Use elseif instead of else if (#8417)
This commit is contained in:
committed by
Neil Lathwood
parent
10237ea097
commit
8cc8eb8dd2
@@ -25,7 +25,7 @@ if (is_admin() === false) {
|
||||
$status = array('status' => 1, 'message' => 'Device dependency cannot be deleted.');
|
||||
}
|
||||
}
|
||||
} else if ($_POST['parent_ids']) {
|
||||
} elseif ($_POST['parent_ids']) {
|
||||
$error = false;
|
||||
foreach ($_POST['parent_ids'] as $parent) {
|
||||
if (is_numeric($parent) && $parent != 0) {
|
||||
@@ -33,7 +33,7 @@ if (is_admin() === false) {
|
||||
$error = true;
|
||||
$status = array('status' => 1, 'message' => 'Device dependency cannot be deleted.');
|
||||
}
|
||||
} else if ($parent == 0) {
|
||||
} elseif ($parent == 0) {
|
||||
$status = array('status' => 1, 'message' => 'No dependency to delete.');
|
||||
$error = true;
|
||||
break;
|
||||
|
||||
@@ -40,7 +40,7 @@ if (is_admin() === false) {
|
||||
foreach ($_POST['parent_ids'] as $parent) {
|
||||
if (is_numeric($parent) && $parent != 0) {
|
||||
$insert[] = array('parent_device_id' => $parent, 'child_device_id' => $dev);
|
||||
} else if ($parent == 0) {
|
||||
} elseif ($parent == 0) {
|
||||
// In case we receive a mixed array with $parent = 0 (which shouldn't happen)
|
||||
// Empty the insert array so we remove any previous dependency so 'None' takes precedence
|
||||
$insert = array();
|
||||
|
||||
Reference in New Issue
Block a user