nextcloud/lib/public/Notification/INotifier.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.6 KiB
PHP
Raw Normal View History

2015-08-31 06:24:37 -04:00
<?php
declare(strict_types=1);
2015-08-31 06:24:37 -04:00
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
2015-08-31 06:24:37 -04:00
*/
namespace OCP\Notification;
2015-08-31 06:24:37 -04:00
/**
* Interface INotifier
*
2016-01-22 04:51:36 -05:00
* @since 9.0.0
2015-08-31 06:24:37 -04:00
*/
interface INotifier {
/**
* Identifier of the notifier, only use [a-z0-9_]
*
* @return string
* @since 17.0.0
*/
public function getID(): string;
/**
* Human-readable name describing the notifier
*
* @return string
* @since 17.0.0
*/
public function getName(): string;
2015-08-31 06:24:37 -04:00
/**
* @param INotification $notification
2015-09-01 04:20:54 -04:00
* @param string $languageCode The code of the language that should be used to prepare the notification
2015-08-31 06:24:37 -04:00
* @return INotification
* @throws UnknownNotificationException When the notification was not prepared by a notifier
* @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
* @throws IncompleteParsedNotificationException Only to be thrown by the {@see IManager}
2016-01-22 04:51:36 -05:00
* @since 9.0.0
* @since 30.0.0 Notifiers should throw {@see UnknownNotificationException} instead of \InvalidArgumentException
* when they did not handle the notification. Throwing \InvalidArgumentException directly is deprecated and will
* be logged as an error in Nextcloud 39.
* @since 30.0.0 Throws {@see IncompleteParsedNotificationException} when not all required fields
* are set at the end of the manager or after a INotifier that claimed to have parsed the notification.
2015-08-31 06:24:37 -04:00
*/
public function prepare(INotification $notification, string $languageCode): INotification;
2015-08-31 06:24:37 -04:00
}