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
This commit is contained in:
TheMysteriousX
2022-04-13 14:25:56 +02:00
committed by GitHub
parent 92354e0a12
commit 95aaa31dd9
+1 -1
View File
@@ -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()
});
}