Adjust notifier to Nextcloud 17
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
committed by
Julius Härtl
parent
799497e62f
commit
f064fe55e2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user