mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Check for empty SLA tags so we skip bad entries (#13679)
* Check for empty SLA tags so we skip bad entries * getSlaTag always return string * accidentally left line * Update phpstan-baseline.neon Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -336,7 +336,7 @@ class Cisco extends OS implements OSDiscovery, SlaDiscovery, ProcessorDiscovery,
|
||||
return $slas;
|
||||
}
|
||||
|
||||
private function getSlaTag($data)
|
||||
private function getSlaTag($data): string
|
||||
{
|
||||
if (! empty($data['rttMonCtrlAdminTag'])) {
|
||||
return $data['rttMonCtrlAdminTag'];
|
||||
@@ -344,11 +344,11 @@ class Cisco extends OS implements OSDiscovery, SlaDiscovery, ProcessorDiscovery,
|
||||
|
||||
switch ($data['rttMonCtrlAdminRttType']) {
|
||||
case 'http':
|
||||
return $data['rttMonEchoAdminURL'];
|
||||
return $data['rttMonEchoAdminURL'] ?? '';
|
||||
case 'dns':
|
||||
return $data['rttMonEchoAdminTargetAddressString'];
|
||||
return $data['rttMonEchoAdminTargetAddressString'] ?? '';
|
||||
case 'echo':
|
||||
return IP::fromHexString($data['rttMonEchoAdminTargetAddress'], true);
|
||||
return IP::fromHexString($data['rttMonEchoAdminTargetAddress'], true) ?? '';
|
||||
case 'jitter':
|
||||
$tag = IP::fromHexString($data['rttMonEchoAdminTargetAddress'], true) . ':' . $data['rttMonEchoAdminTargetPort'];
|
||||
if (isset($data['rttMonEchoAdminCodecType']) && $data['rttMonEchoAdminCodecType'] != 'notApplicable') {
|
||||
|
@@ -4290,11 +4290,6 @@ parameters:
|
||||
count: 1
|
||||
path: LibreNMS/OS/Shared/Cisco.php
|
||||
|
||||
-
|
||||
message: "#^Method LibreNMS\\\\OS\\\\Shared\\\\Cisco\\:\\:getSlaTag\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: LibreNMS/OS/Shared/Cisco.php
|
||||
|
||||
-
|
||||
message: "#^Method LibreNMS\\\\OS\\\\Shared\\\\Cisco\\:\\:getSlaTag\\(\\) has parameter \\$data with no type specified\\.$#"
|
||||
count: 1
|
||||
|
Reference in New Issue
Block a user