From 95aaa31dd9d4768381a86d37347e2c88ffd46672 Mon Sep 17 00:00:00 2001 From: TheMysteriousX Date: Wed, 13 Apr 2022 13:25:56 +0100 Subject: [PATCH] Sensu: Correct type hint (#13915) * Correct type annotation Not 100% sure this is correct as I don't know what the previous change was trying to correct - but they're definitely not all strings. * Correct the correction --- LibreNMS/Alert/Transport/Sensu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibreNMS/Alert/Transport/Sensu.php b/LibreNMS/Alert/Transport/Sensu.php index a6b0b4db82..b39222424f 100644 --- a/LibreNMS/Alert/Transport/Sensu.php +++ b/LibreNMS/Alert/Transport/Sensu.php @@ -151,7 +151,7 @@ class Sensu extends Transport 'librenms-device-id' => strval($obj['device_id']), 'librenms-rule-id' => strval($obj['rule_id']), 'librenms-status-reason' => $obj['status_reason'], - ], function (string $s): bool { + ], function (?string $s): bool { return (bool) strlen($s); // strlen returns 0 for null, false or '', but 1 for integer 0 - unlike empty() }); }