From a7c3f8ddf85606cb259d0a90b44579f66d7e8440 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Dec 2024 15:15:11 +0100 Subject: [PATCH] fix(notifications): Notifier::prepare() threw \InvalidArgumentException which is deprecated Signed-off-by: Joas Schilling --- lib/Notification/Notifier.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 55b0ee53b7..ec965d3d3a 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -14,6 +14,7 @@ use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { private IFactory $factory; @@ -41,7 +42,7 @@ public function getName(): string { public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) { // Not my app => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } // Read the language from the notification @@ -69,7 +70,7 @@ public function prepare(INotification $notification, string $languageCode): INot ]); break; default: - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } return $notification;