Apply fixes from StyleCI (#12120)

This commit is contained in:
Jellyfrog
2020-09-21 15:40:17 +02:00
committed by GitHub
co-authored by GitHub
parent 77c531527c
commit 82f43cb98d
1733 changed files with 18337 additions and 18540 deletions
+10 -10
View File
@@ -14,30 +14,30 @@
header('Content-type: application/json');
if (!Auth::user()->hasGlobalAdmin()) {
$response = array(
if (! Auth::user()->hasGlobalAdmin()) {
$response = [
'status' => 'error',
'message' => 'Need to be admin',
);
];
echo _json_encode($response);
exit;
}
$status = 'error';
$status = 'error';
$message = 'Error updating processor information';
$device_id = mres($_POST['device_id']);
$processor_id = mres($_POST['processor_id']);
$data = mres($_POST['data']);
if (!is_numeric($device_id)) {
if (! is_numeric($device_id)) {
$message = 'Missing device id';
} elseif (!is_numeric($processor_id)) {
} elseif (! is_numeric($processor_id)) {
$message = 'Missing processor id';
} elseif (!is_numeric($data)) {
} elseif (! is_numeric($data)) {
$message = 'Missing value';
} else {
if (dbUpdate(array('processor_perc_warn'=>$data), 'processors', '`processor_id`=? AND `device_id`=?', array($processor_id,$device_id)) >= 0) {
if (dbUpdate(['processor_perc_warn'=>$data], 'processors', '`processor_id`=? AND `device_id`=?', [$processor_id, $device_id]) >= 0) {
$message = 'Processor information updated';
$status = 'ok';
} else {
@@ -45,9 +45,9 @@ if (!is_numeric($device_id)) {
}
}
$response = array(
$response = [
'status' => $status,
'message' => $message,
'extra' => $extra,
);
];
echo _json_encode($response);