Skip to content

Commit 5141012

Browse files
refactor: safe PHP 7.4 modernization (arrays, null coalescing)
1 parent fb9fa5b commit 5141012

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

monitor_render.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,13 +670,13 @@ function getHostStatus(array $host, bool $real = false): int {
670670
global $thold_hosts, $iclasses;
671671

672672
// If the host has been muted, show the muted Icon
673-
if ($host['status'] != 1 && in_array($host['id'], $thold_hosts, true)) {
673+
if ($host['status'] != 1 && in_[$host['id'], $thold_hosts, true]) {
674674
$host['status'] = 4;
675675
}
676676

677-
if (in_array($host['id'], $_SESSION['monitor_muted_hosts'], true) && $host['status'] == 1) {
677+
if (in_[$host['id'], $_SESSION['monitor_muted_hosts'], true] && $host['status'] == 1) {
678678
$host['status'] = 5;
679-
} elseif (in_array($host['id'], $_SESSION['monitor_muted_hosts'], true) && $host['status'] == 4) {
679+
} elseif (in_[$host['id'], $_SESSION['monitor_muted_hosts'], true] && $host['status'] == 4) {
680680
$host['status'] = 9;
681681
} elseif ($host['status'] == 3) {
682682
if ($host['cur_time'] > $host['monitor_alert'] && !empty($host['monitor_alert'])) {

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ function monitor_device_action_prepare($save) {
397397
}
398398
}
399399

400-
function monitor_device_action_array($device_action_array) {
400+
function monitor_device_action_[$device_action_array] {
401401
$device_action_array['monitor_settings'] = __('Change Monitoring Options', 'monitor');
402402
$device_action_array['monitor_enable'] = __('Enable Monitoring', 'monitor');
403403
$device_action_array['monitor_disable'] = __('Disable Monitoring', 'monitor');

0 commit comments

Comments
 (0)