@@ -235,12 +235,12 @@ public function getNotificationData(Alert $alert): array|bool
235235 public function clearStaleAlerts (): void
236236 {
237237 Alert::where ('state ' , '!= ' , AlertState::CLEAR )
238- ->where (function ($ query ) {
238+ ->where (function ($ query ): void {
239239 $ query ->whereDoesntHave ('device ' )
240240 ->orWhereDoesntHave ('rule ' );
241241 })
242242 ->get ()
243- ->each (function (Alert $ alert ) {
243+ ->each (function (Alert $ alert ): void {
244244 echo "Stale-alert: # {$ alert ->id }" . PHP_EOL ;
245245 $ alert ->delete ();
246246 });
@@ -312,7 +312,7 @@ public function issueAlert(Alert $alert): bool
312312 public function runAcks (): void
313313 {
314314 $ this ->loadAlerts ('alerts.state = ' . AlertState::ACKNOWLEDGED . ' && alerts.open = ' . AlertState::ACTIVE )
315- ->each (function (Alert $ alert ) {
315+ ->each (function (Alert $ alert ): void {
316316 $ rextra = $ alert ->rule ->extra ;
317317 if ($ rextra ['acknowledgement ' ] ?? true ) {
318318 $ this ->issueAlert ($ alert );
@@ -329,7 +329,7 @@ public function runAcks(): void
329329 public function runFollowUp (): void
330330 {
331331 $ this ->loadAlerts ('alerts.state > ' . AlertState::CLEAR . ' && alerts.open = 0 ' )
332- ->each (function (Alert $ alert ) {
332+ ->each (function (Alert $ alert ): void {
333333 $ this ->processFollowUp ($ alert );
334334 });
335335 }
@@ -518,7 +518,7 @@ public function loadAlerts(string $where): Collection
518518 public function runAlerts (): void
519519 {
520520 $ this ->loadAlerts ('alerts.state != ' . AlertState::ACKNOWLEDGED . ' && alerts.open = 1 ' )
521- ->each (function (Alert $ alert ) {
521+ ->each (function (Alert $ alert ): void {
522522 $ this ->processAlert ($ alert );
523523 });
524524 }
0 commit comments