From 61bb3d0a3aa79681c29bd2aa7c4a636e045c738f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 17 Jul 2025 10:28:03 +0200 Subject: [PATCH 1/2] fix(ExAppNotifier): First check if any exapps enabled To avoid unnecessary work and logs Signed-off-by: Marcel Klehr --- lib/Notifications/ExAppNotifier.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Notifications/ExAppNotifier.php b/lib/Notifications/ExAppNotifier.php index ac25b023..cf2081a4 100644 --- a/lib/Notifications/ExAppNotifier.php +++ b/lib/Notifications/ExAppNotifier.php @@ -36,6 +36,9 @@ public function getName(): string { } public function prepare(INotification $notification, string $languageCode): INotification { + if (count($this->service->getExAppsList()) === 0) { + throw new UnknownNotificationException(); + } $exApp = $this->service->getExApp($notification->getApp()); if ($exApp === null) { throw new UnknownNotificationException(); From fdbfa0241c02dc65e8c4b9f4104af8918d5be59e Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 17 Jul 2025 10:46:33 +0200 Subject: [PATCH 2/2] fix(ExAppNotifier): Use empty() instead of count() more performant Signed-off-by: Marcel Klehr --- lib/Notifications/ExAppNotifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Notifications/ExAppNotifier.php b/lib/Notifications/ExAppNotifier.php index cf2081a4..34e237de 100644 --- a/lib/Notifications/ExAppNotifier.php +++ b/lib/Notifications/ExAppNotifier.php @@ -36,7 +36,7 @@ public function getName(): string { } public function prepare(INotification $notification, string $languageCode): INotification { - if (count($this->service->getExAppsList()) === 0) { + if (empty($this->service->getExAppsList())) { throw new UnknownNotificationException(); } $exApp = $this->service->getExApp($notification->getApp());