File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,7 @@ public function registerNavigationEntry() {
141141
142142 public function registerNotifications () {
143143 $ notificationManager = \OC ::$ server ->getNotificationManager ();
144- $ self = &$ this ;
145- $ notificationManager ->registerNotifier (function () use (&$ self ) {
146- return $ self ->getContainer ()->query (Notifier::class);
147- }, function () {
148- return ['id ' => 'deck ' , 'name ' => 'Deck ' ];
149- });
144+ $ notificationManager ->registerNotifierService (Notifier::class);
150145 }
151146
152147 /**
Original file line number Diff line number Diff line change @@ -57,14 +57,34 @@ public function __construct(
5757 $ this ->boardMapper = $ boardMapper ;
5858 }
5959
60+ /**
61+ * Identifier of the notifier, only use [a-z0-9_]
62+ *
63+ * @return string
64+ * @since 17.0.0
65+ */
66+ public function getID (): string {
67+ return 'deck ' ;
68+ }
69+
70+ /**
71+ * Human readable name describing the notifier
72+ *
73+ * @return string
74+ * @since 17.0.0
75+ */
76+ public function getName (): string {
77+ return $ this ->l10nFactory ->get ('deck ' )->t ('Deck ' );
78+ }
79+
6080 /**
6181 * @param INotification $notification
6282 * @param string $languageCode The code of the language that should be used to prepare the notification
6383 * @return INotification
6484 * @throws \InvalidArgumentException When the notification was not prepared by a notifier
6585 * @since 9.0.0
6686 */
67- public function prepare (INotification $ notification , $ languageCode ) {
87+ public function prepare (INotification $ notification , string $ languageCode ): INotification {
6888 $ l = $ this ->l10nFactory ->get ('deck ' , $ languageCode );
6989 if ($ notification ->getApp () !== 'deck ' ) {
7090 throw new \InvalidArgumentException ();
You can’t perform that action at this time.
0 commit comments