From ed94658ad770224e34825d27a1aec26aa482020f Mon Sep 17 00:00:00 2001 From: "S.J. Guillot" <58807831+sjg2203@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:34:25 +0100 Subject: [PATCH] Fix deprecated InvalidArgumentException usage in Notifier.php Refactor createNotificationException to always return UnknownNotificationException. Signed-off-by: S.J. Guillot <58807831+sjg2203@users.noreply.github.com> --- lib/Notification/Notifier.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index b59ec031..98b9c58d 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -48,13 +48,11 @@ public function getName(): string { } private function createNotificationException(string $message): \Exception { - return class_exists(UnknownNotificationException::class) - ? new UnknownNotificationException($message) - : new \InvalidArgumentException($message); + return new UnknownNotificationException($message); } /** - * @throws \InvalidArgumentException When the notification was not prepared by a notifier + * @throws \OCP\Notification\UnknownNotificationException When the notification is not known */ public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) {