Adjust notifier to Nextcloud 17

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling
2019-07-16 12:02:40 +02:00
committed by Julius Härtl
parent 799497e62f
commit f064fe55e2
2 changed files with 22 additions and 7 deletions

View File

@@ -57,6 +57,26 @@ class Notifier implements INotifier {
$this->boardMapper = $boardMapper;
}
/**
* Identifier of the notifier, only use [a-z0-9_]
*
* @return string
* @since 17.0.0
*/
public function getID(): string {
return 'deck';
}
/**
* Human readable name describing the notifier
*
* @return string
* @since 17.0.0
*/
public function getName(): string {
return $this->l10nFactory->get('deck')->t('Deck');
}
/**
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
@@ -64,7 +84,7 @@ class Notifier implements INotifier {
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
* @since 9.0.0
*/
public function prepare(INotification $notification, $languageCode) {
public function prepare(INotification $notification, string $languageCode): INotification {
$l = $this->l10nFactory->get('deck', $languageCode);
if ($notification->getApp() !== 'deck') {
throw new \InvalidArgumentException();