summaryrefslogtreecommitdiffstats
path: root/lib/private/Notification/Manager.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-16 11:36:32 +0200
committerJoas Schilling <coding@schilljs.com>2019-07-16 11:36:32 +0200
commit55f5bc79a148f065cffa8c97e1867c5814047ff0 (patch)
treef7873ae6cce3d3fa96ea620854e36f2470c25e3a /lib/private/Notification/Manager.php
parent6d71e471e166c30c0b9abe05d36240b9f1556d8e (diff)
downloadnextcloud-server-55f5bc79a148f065cffa8c97e1867c5814047ff0.tar.gz
nextcloud-server-55f5bc79a148f065cffa8c97e1867c5814047ff0.zip
Keep the old method as a fallback and adjust the tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification/Manager.php')
-rw-r--r--lib/private/Notification/Manager.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php
index 2ed7aa7c176..9cca86a4bda 100644
--- a/lib/private/Notification/Manager.php
+++ b/lib/private/Notification/Manager.php
@@ -74,12 +74,27 @@ class Manager implements IManager {
}
/**
- * @param string $notifierClass The service must implement INotifier, otherwise a
+ * @param \Closure $service The service must implement INotifier, otherwise a
+ * \InvalidArgumentException is thrown later
+ * @param \Closure $info An array with the keys 'id' and 'name' containing
+ * the app id and the app name
+ * @deprecated 17.0.0 use registerNotifierService instead.
+ * @since 8.2.0 - Parameter $info was added in 9.0.0
+ */
+ public function registerNotifier(\Closure $service, \Closure $info) {
+ $infoData = $info();
+ $this->logger->logException(new \InvalidArgumentException(
+ 'Notifier ' . $infoData['name'] . ' (id: ' . $infoData['id'] . ') is not considered because it is using the old way to register.'
+ ));
+ }
+
+ /**
+ * @param string $notifierService The service must implement INotifier, otherwise a
* \InvalidArgumentException is thrown later
* @since 17.0.0
*/
- public function registerNotifier(string $notifierClass): void {
- $this->notifierClasses[] = $notifierClass;
+ public function registerNotifierService(string $notifierService): void {
+ $this->notifierClasses[] = $notifierService;
}
/**
@@ -111,6 +126,8 @@ class Manager implements IManager {
$this->apps[] = $app;
}
+ $this->appClasses = [];
+
return $this->apps;
}
@@ -143,6 +160,8 @@ class Manager implements IManager {
$this->notifiers[] = $notifier;
}
+ $this->notifierClasses = [];
+
return $this->notifiers;
}