mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Misc cleanup (#12758)
* Fix Docblock * Misc * Parameter #2 $callback of function array_filter expects (callable(mixed, mixed): bool)|null, 'strlen' given * Parameter #2 $data of function hash_hmac expects string, int given * Unreachable statement - code above always terminates. * Update Device.php
This commit is contained in:
@@ -39,7 +39,7 @@ class Kayako extends Transport
|
||||
$ticket_type = 1;
|
||||
$ticket_status = 1;
|
||||
$ticket_prio = 1;
|
||||
$salt = mt_rand();
|
||||
$salt = bin2hex(random_bytes(20));
|
||||
$signature = base64_encode(hash_hmac('sha256', $salt, $secret, true));
|
||||
|
||||
$protocol = [
|
||||
|
@@ -143,7 +143,9 @@ class Sensu extends Transport
|
||||
'librenms-device-id' => strval($obj['device_id']),
|
||||
'librenms-rule-id' => strval($obj['rule_id']),
|
||||
'librenms-status-reason' => $obj['status_reason'],
|
||||
], 'strlen'); // strlen returns 0 for null, false or '', but 1 for integer 0 - unlike empty()
|
||||
], function (string $s): bool {
|
||||
return (bool) strlen($s); // strlen returns 0 for null, false or '', but 1 for integer 0 - unlike empty()
|
||||
});
|
||||
}
|
||||
|
||||
public static function calculateStatus($state, $severity)
|
||||
|
Reference in New Issue
Block a user