Apply fixes from StyleCI (#12117)

* Apply fixes from StyleCI

* Disable style check
This commit is contained in:
Jellyfrog
2020-09-21 14:54:51 +02:00
committed by GitHub
parent 8ec9183df5
commit 77c531527c
752 changed files with 6238 additions and 5833 deletions

View File

@@ -157,8 +157,8 @@ class Rewrite
*/
public static function macToHex($mac)
{
$mac_array = explode(':', str_replace(['-','.'], ':', $mac));
$mac_padding = array_fill(0, count($mac_array), 12/count($mac_array));
$mac_array = explode(':', str_replace(['-', '.'], ':', $mac));
$mac_padding = array_fill(0, count($mac_array), 12 / count($mac_array));
return implode(array_map('zeropad', $mac_array, $mac_padding));
}
@@ -175,13 +175,13 @@ class Rewrite
if ($device['os'] == "ios") {
if ($device['hardware']) {
if (preg_match("/^WS-C([A-Za-z0-9]+)/", $device['hardware'], $matches)) {
if (!$short) {
if (! $short) {
$device['hardware'] = "Catalyst " . $matches[1] . " (" . $device['hardware'] . ")";
} else {
$device['hardware'] = "Catalyst " . $matches[1];
}
} elseif (preg_match("/^CISCO([0-9]+)(.*)/", $device['hardware'], $matches)) {
if (!$short && $matches[2]) {
if (! $short && $matches[2]) {
$device['hardware'] = "Cisco " . $matches[1] . " (" . $device['hardware'] . ")";
} else {
$device['hardware'] = "Cisco " . $matches[1];
@@ -197,7 +197,7 @@ class Rewrite
if ($device['os'] == "iosxe") {
if ($device['hardware']) {
if (preg_match('/CAT9K/', $device['sysDescr'], $matches) && preg_match("/^C(9[A-Za-z0-9]+)/", $device['hardware'], $matches2)) {
if (!$short) {
if (! $short) {
$device['hardware'] = "Catalyst " . $matches2[1] . " (" . $device['hardware'] . ")";
} else {
$device['hardware'] = "Catalyst " . $matches2[1];
@@ -238,7 +238,6 @@ class Rewrite
return $location;
}
public static function vmwareGuest($guest_id)
{
$guests = [