From 2ab1b8f033f09cd39d723875f8d7aa6c9061d51d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Dec 2024 15:03:20 +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 137c751560..d94c0f0ccf 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -12,6 +12,7 @@ use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { private IFactory $factory; @@ -39,7 +40,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 @@ -83,7 +84,7 @@ public function prepare(INotification $notification, string $languageCode): INot ]); break; default: - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } return $notification;