mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#12120)
This commit is contained in:
@@ -22,14 +22,14 @@ $param = [];
|
||||
$sql = "";
|
||||
if (isset($device['device_id']) && $device['device_id'] > 0) {
|
||||
$sql = " AND alert_log.device_id=?";
|
||||
$param = array(
|
||||
$device['device_id']
|
||||
);
|
||||
$param = [
|
||||
$device['device_id'],
|
||||
];
|
||||
}
|
||||
|
||||
if (!Auth::user()->hasGlobalRead()) {
|
||||
if (! Auth::user()->hasGlobalRead()) {
|
||||
$device_ids = Permissions::devicesForUser()->toArray() ?: [0];
|
||||
$sql .= " AND `alert_log`.`device_id` IN " .dbGenPlaceholders(count($device_ids));
|
||||
$sql .= " AND `alert_log`.`device_id` IN " . dbGenPlaceholders(count($device_ids));
|
||||
$param = array_merge($param, $device_ids);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ $query = "SELECT DATE_FORMAT(time_logged, '" . \LibreNMS\Config::get('alert_grap
|
||||
|
||||
var container = document.getElementById('visualization');
|
||||
<?php
|
||||
$groups = array();
|
||||
$groups = [];
|
||||
$max_count = 0;
|
||||
|
||||
foreach (dbFetchRows($query, $param) as $return_value) {
|
||||
@@ -61,12 +61,12 @@ $query = "SELECT DATE_FORMAT(time_logged, '" . \LibreNMS\Config::get('alert_grap
|
||||
}
|
||||
|
||||
$severity = $return_value['Severity'];
|
||||
$data[] = array(
|
||||
'x' => $date,
|
||||
'y' => $count,
|
||||
'group' => $severity
|
||||
);
|
||||
if (!in_array($severity, $groups)) {
|
||||
$data[] = [
|
||||
'x' => $date,
|
||||
'y' => $count,
|
||||
'group' => $severity,
|
||||
];
|
||||
if (! in_array($severity, $groups)) {
|
||||
array_push($groups, $severity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user