diff options
author | Joas Schilling <coding@schilljs.com> | 2018-07-13 10:13:49 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-07-13 13:27:52 +0200 |
commit | 79b540ecc39202154d2374a96a1d255091b39f22 (patch) | |
tree | bbbdd2d35a28a189b256af8ff9e2da8e1b7f0e83 /lib/private/Notification | |
parent | 28d8d15a98df5adeec970b0cfc6fb50937aca8e2 (diff) | |
download | nextcloud-server-79b540ecc39202154d2374a96a1d255091b39f22.tar.gz nextcloud-server-79b540ecc39202154d2374a96a1d255091b39f22.zip |
Add return types and fully qualified function calls
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification')
-rw-r--r-- | lib/private/Notification/Manager.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php index 69c24e4f9e4..4c3f7a2453c 100644 --- a/lib/private/Notification/Manager.php +++ b/lib/private/Notification/Manager.php @@ -99,7 +99,7 @@ class Manager implements IManager { /** * @return IApp[] */ - protected function getApps() { + protected function getApps(): array { if (!empty($this->apps)) { return $this->apps; } @@ -119,7 +119,7 @@ class Manager implements IManager { /** * @return INotifier[] */ - protected function getNotifiers() { + protected function getNotifiers(): array { if (!empty($this->notifiers)) { return $this->notifiers; } @@ -139,7 +139,7 @@ class Manager implements IManager { /** * @return array[] */ - public function listNotifiers() { + public function listNotifiers(): array { if (!empty($this->notifiersInfo)) { return $this->notifiersInfo; } @@ -147,7 +147,7 @@ class Manager implements IManager { $this->notifiersInfo = []; foreach ($this->notifiersInfoClosures as $closure) { $notifier = $closure(); - if (!is_array($notifier) || count($notifier) !== 2 || !isset($notifier['id']) || !isset($notifier['name'])) { + if (!\is_array($notifier) || \count($notifier) !== 2 || !isset($notifier['id'], $notifier['name'])) { throw new \InvalidArgumentException('The given notifier information is invalid'); } if (isset($this->notifiersInfo[$notifier['id']])) { @@ -163,7 +163,7 @@ class Manager implements IManager { * @return INotification * @since 8.2.0 */ - public function createNotification() { + public function createNotification(): INotification { return new Notification($this->validator); } @@ -171,7 +171,7 @@ class Manager implements IManager { * @return bool * @since 8.2.0 */ - public function hasNotifiers() { + public function hasNotifiers(): bool { return !empty($this->notifiersClosures); } @@ -218,7 +218,7 @@ class Manager implements IManager { * @throws \InvalidArgumentException When the notification was not prepared by a notifier * @since 8.2.0 */ - public function prepare(INotification $notification, $languageCode) { + public function prepare(INotification $notification, $languageCode): INotification { $notifiers = $this->getNotifiers(); foreach ($notifiers as $notifier) { @@ -255,7 +255,7 @@ class Manager implements IManager { * @param INotification $notification * @return int */ - public function getCount(INotification $notification) { + public function getCount(INotification $notification): int { $apps = $this->getApps(); $count = 0; |