refactor: Use elseif instead of else if (#8417)

This commit is contained in:
Tony Murray
2018-03-19 16:40:17 -05:00
committed by Neil Lathwood
parent 10237ea097
commit 8cc8eb8dd2
13 changed files with 27 additions and 27 deletions

View File

@@ -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;

View File

@@ -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();