Apply fixes from StyleCI (#15698)

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Jellyfrog
2024-01-05 05:39:12 +01:00
committed by GitHub
parent 58becd9ea2
commit 071ca9bc2a
615 changed files with 4562 additions and 4554 deletions

View File

@@ -95,24 +95,24 @@ function cleanPort($interface, $device = null)
function makeshortif($if)
{
$rewrite_shortif = [
'tengigabitethernet' => 'Te',
'tengigabitethernet' => 'Te',
'ten-gigabitethernet' => 'Te',
'tengige' => 'Te',
'gigabitethernet' => 'Gi',
'fastethernet' => 'Fa',
'ethernet' => 'Et',
'serial' => 'Se',
'pos' => 'Pos',
'port-channel' => 'Po',
'atm' => 'Atm',
'null' => 'Null',
'loopback' => 'Lo',
'dialer' => 'Di',
'vlan' => 'Vlan',
'tunnel' => 'Tunnel',
'serviceinstance' => 'SI',
'dwdm' => 'DWDM',
'bundle-ether' => 'BE',
'tengige' => 'Te',
'gigabitethernet' => 'Gi',
'fastethernet' => 'Fa',
'ethernet' => 'Et',
'serial' => 'Se',
'pos' => 'Pos',
'port-channel' => 'Po',
'atm' => 'Atm',
'null' => 'Null',
'loopback' => 'Lo',
'dialer' => 'Di',
'vlan' => 'Vlan',
'tunnel' => 'Tunnel',
'serviceinstance' => 'SI',
'dwdm' => 'DWDM',
'bundle-ether' => 'BE',
];
$if = \LibreNMS\Util\Rewrite::normalizeIfName($if);
@@ -126,8 +126,8 @@ function rewrite_generic_hardware($hardware)
{
$rewrite_GenericHW = [
' Computer Corporation' => '',
' Corporation' => '',
' Inc.' => '',
' Corporation' => '',
' Inc.' => '',
];
return str_replace(array_keys($rewrite_GenericHW), array_values($rewrite_GenericHW), $hardware);
@@ -138,10 +138,10 @@ function short_hrDeviceDescr($dev)
$rewrite_hrDevice = [
'GenuineIntel:' => '',
'AuthenticAMD:' => '',
'Intel(R)' => '',
'CPU' => '',
'(R)' => '',
' ' => ' ',
'Intel(R)' => '',
'CPU' => '',
'(R)' => '',
' ' => ' ',
];
$dev = str_replace(array_keys($rewrite_hrDevice), array_values($rewrite_hrDevice), $dev);
@@ -166,10 +166,10 @@ function short_port_descr($desc)
function rewrite_adslLineType($adslLineType)
{
$adslLineTypes = [
'noChannel' => 'No Channel',
'fastOnly' => 'Fastpath',
'interleavedOnly' => 'Interleaved',
'fastOrInterleaved' => 'Fast/Interleaved',
'noChannel' => 'No Channel',
'fastOnly' => 'Fastpath',
'interleavedOnly' => 'Interleaved',
'fastOrInterleaved' => 'Fast/Interleaved',
'fastAndInterleaved' => 'Fast+Interleaved',
];
@@ -297,7 +297,7 @@ function parse_entity_state($state, $value)
return $data[$state][$value];
}
return ['text'=>'na', 'color'=>'default'];
return ['text' => 'na', 'color' => 'default'];
}
function parse_entity_state_alarm($bits)