summaryrefslogtreecommitdiffstats
path: root/lib/private/Notification
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-11-08 15:56:39 +0100
committerJoas Schilling <coding@schilljs.com>2016-11-09 08:52:07 +0100
commit706b5c3fb6e9d911c147c92fc768df86990d09ea (patch)
tree0b7f8d67289ee4d7e667a85c92a662097812f6d2 /lib/private/Notification
parent05cf1dab4ca7d69a837c2c9e890f078cef76c744 (diff)
downloadnextcloud-server-706b5c3fb6e9d911c147c92fc768df86990d09ea.tar.gz
nextcloud-server-706b5c3fb6e9d911c147c92fc768df86990d09ea.zip
Use a php class for the definitions to avoid loading problems
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification')
-rw-r--r--lib/private/Notification/Manager.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php
index 4b57db4bac9..c5cad7f2db3 100644
--- a/lib/private/Notification/Manager.php
+++ b/lib/private/Notification/Manager.php
@@ -24,13 +24,16 @@
namespace OC\Notification;
-use OC\RichObjectStrings\Validator;
use OCP\Notification\IApp;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
+use OCP\RichObjectStrings\IValidator;
class Manager implements IManager {
+ /** @var IValidator */
+ protected $validator;
+
/** @var IApp[] */
protected $apps;
@@ -49,7 +52,13 @@ class Manager implements IManager {
/** @var \Closure[] */
protected $notifiersInfoClosures;
- public function __construct() {
+ /**
+ * Manager constructor.
+ *
+ * @param IValidator $validator
+ */
+ public function __construct(IValidator $validator) {
+ $this->validator = $validator;
$this->apps = [];
$this->notifiers = [];
$this->notifiersInfo = [];
@@ -150,9 +159,7 @@ class Manager implements IManager {
* @since 8.2.0
*/
public function createNotification() {
- return new Notification(
- new Validator()
- );
+ return new Notification($this->validator);
}
/**
@@ -214,7 +221,6 @@ class Manager implements IManager {
/**
* @param INotification $notification
- * @return null
*/
public function markProcessed(INotification $notification) {
$apps = $this->getApps();