PSR2 Cleanup: /html edition

Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
This commit is contained in:
Tony Murray
2016-08-18 20:28:22 -05:00
parent f0c82498b5
commit 8c639aa5a4
468 changed files with 6605 additions and 7629 deletions

View File

@@ -46,8 +46,7 @@ if (!empty($_POST['type'])) {
if ($_POST['type'] == 'generic') {
$sql .= " AND ( type = ? OR type = '')";
$param[] = $_POST['type'];
}
else {
} else {
$sql .= ' AND type = ?';
$param[] = $_POST['type'];
}
@@ -57,8 +56,7 @@ if (!empty($_POST['state'])) {
$sql .= ' AND status= ?';
if (is_numeric($_POST['state'])) {
$param[] = $_POST['state'];
}
else {
} else {
$param[] = str_replace(array('up', 'down'), array(1, 0), $_POST['state']);
}
}
@@ -127,16 +125,14 @@ list($format, $subformat) = explode('_', $_POST['format']);
foreach (dbFetchRows($sql, $param) as $device) {
if (isset($bg) && $bg == $list_colour_b) {
$bg = $list_colour_a;
}
else {
} else {
$bg = $list_colour_b;
}
if ($device['status'] == '0') {
$extra = 'danger';
$msg = $device['status_reason'];
}
else {
} else {
$extra = 'success';
$msg = 'up';
}
@@ -197,8 +193,7 @@ foreach (dbFetchRows($sql, $param) as $device) {
$os = $device['os_text'].'<br />'.$device['version'];
if (extension_loaded('mbstring')) {
$location = mb_substr($device['location'], 0, 32, 'utf8');
}
else {
} else {
$location = truncate($device['location'], 32, '');
}
@@ -216,8 +211,7 @@ foreach (dbFetchRows($sql, $param) as $device) {
if ($sensor_count) {
$col_port .= ' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count;
}
}
else {
} else {
}
$response[] = array(