jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375737 )

Change subject: BS3: New Notification infrastructure
......................................................................


BS3: New Notification infrastructure

Change-Id: Ib9e80e7e7684d1039c99018f22967f2497ebed21
---
A src/INotification.php
A src/INotifier.php
A src/LegacyNotifier.php
A src/NotifierFactory.php
4 files changed, 74 insertions(+), 0 deletions(-)

Approvals:
  Pwirth: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/INotification.php b/src/INotification.php
new file mode 100644
index 0000000..30618b2
--- /dev/null
+++ b/src/INotification.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace BlueSpice;
+
+interface INotification {
+       /**
+        * @return string
+        */
+       public function getKey();
+
+       /**
+        * @return array
+        */
+       public function getParams();
+
+       /**
+        * @return \Title|null The title the notification is about. May be null.
+        */
+       public function getTitle();
+
+       /**
+        * @return \User The user that initiated the notification
+        */
+       public function getUser();
+}
diff --git a/src/INotifier.php b/src/INotifier.php
new file mode 100644
index 0000000..627af6c
--- /dev/null
+++ b/src/INotifier.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace BlueSpice;
+
+interface INotifier {
+
+       /**
+        *
+        * @param INotification $notification
+        */
+       public function notify( $notification );
+}
\ No newline at end of file
diff --git a/src/LegacyNotifier.php b/src/LegacyNotifier.php
new file mode 100644
index 0000000..8e3b0fc
--- /dev/null
+++ b/src/LegacyNotifier.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace BlueSpice;
+
+class LegacyNotifier implements INotifier {
+
+
+       /**
+        *
+        * @param INotification $notification
+        * @return \Status
+        */
+       public function notify( $notification ) {
+               \BSNotificationHandler::notify(
+                       $notification->getKey(),
+                       $notification->getUser(),
+                       $notification->getTitle(),
+                       $notification->getParams()
+               );
+
+               return \Status::newGood();
+       }
+}
\ No newline at end of file
diff --git a/src/NotifierFactory.php b/src/NotifierFactory.php
new file mode 100644
index 0000000..778ec6b
--- /dev/null
+++ b/src/NotifierFactory.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace BlueSpice;
+
+class NotifierFactory {
+
+       /**
+        *
+        * @return \BlueSpice\INotifier
+        */
+       public function newNotifier() {
+               return new LegacyNotifier();
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/375737
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9e80e7e7684d1039c99018f22967f2497ebed21
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>
Gerrit-Reviewer: Ljonka <[email protected]>
Gerrit-Reviewer: Mglaser <[email protected]>
Gerrit-Reviewer: Pwirth <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to