Apply fixes from StyleCI (#12120)

This commit is contained in:
Jellyfrog
2020-09-21 15:40:17 +02:00
committed by GitHub
parent 77c531527c
commit 82f43cb98d
1733 changed files with 18337 additions and 18540 deletions

View File

@@ -5,7 +5,7 @@ $device_id = mres($vars['device_id']);
$sql = " FROM `processors` AS `P` LEFT JOIN `devices` AS `D` ON `P`.`device_id` = `D`.`device_id` WHERE `D`.`device_id`=?";
$param[] = $device_id;
if (isset($searchPhrase) && !empty($searchPhrase)) {
if (isset($searchPhrase) && ! empty($searchPhrase)) {
$sql .= " AND (`D`.`hostname` LIKE ? OR `P`.`processor_descr` LIKE ? OR `S`.`processor_usage` LIKE ? OR `P`.`processor_perc_warn` LIKE ?)";
$param[] = "%$searchPhrase%";
$param[] = "%$searchPhrase%";
@@ -20,7 +20,7 @@ if (empty($total)) {
$total = 0;
}
if (!isset($sort) || empty($sort)) {
if (! isset($sort) || empty($sort)) {
$sort = '`D`.`hostname`, `P`.`processor_descr`';
}
@@ -40,13 +40,13 @@ $sql = "SELECT * $sql";
foreach (dbFetchRows($sql, $param) as $drive) {
$perc = round($drive['processor_usage'], 0);
$perc_warn = round($drive['processor_perc_warn'], 0);
$response[] = array(
$response[] = [
'processor_id' => $drive['processor_id'],
'hostname' => generate_device_link($drive),
'processor_descr' => $drive['processor_descr'],
'processor_perc' => $perc . "%",
'processor_perc_warn' => $perc_warn);
'processor_perc_warn' => $perc_warn, ];
}
$output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$total);
$output = ['current'=>$current, 'rowCount'=>$rowCount, 'rows'=>$response, 'total'=>$total];
echo _json_encode($output);