Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-02-16 15:12:22 +0300
committerJoas Schilling <coding@schilljs.com>2018-02-16 15:49:34 +0300
commitf753873b2d52e9d6ccac2433e8de5341aaea36e8 (patch)
tree1fef03374f1d08e7d79f9a69f21faed0baa8ce0c /lib
parente80405d97b6cac87ee785580307db9436f30ee2f (diff)
PHP 7.0 requirement
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Command/Generate.php2
-rw-r--r--lib/Controller/APIController.php5
-rw-r--r--lib/Notifier/AdminNotifications.php2
3 files changed, 3 insertions, 6 deletions
diff --git a/lib/Command/Generate.php b/lib/Command/Generate.php
index 363b201..9c52914 100644
--- a/lib/Command/Generate.php
+++ b/lib/Command/Generate.php
@@ -86,7 +86,7 @@ class Generate extends Command {
* @param OutputInterface $output
* @return int
*/
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$userId = $input->getArgument('user-id');
$subject = $input->getArgument('short-message');
diff --git a/lib/Controller/APIController.php b/lib/Controller/APIController.php
index 6328cb4..31fd45b 100644
--- a/lib/Controller/APIController.php
+++ b/lib/Controller/APIController.php
@@ -64,10 +64,7 @@ class APIController extends OCSController {
* @param string $longMessage
* @return DataResponse
*/
- public function generateNotification($userId, $shortMessage, $longMessage) {
- $shortMessage = (string) $shortMessage;
- $longMessage = (string) $longMessage;
-
+ public function generateNotification(string $userId, string $shortMessage, string $longMessage = ''): DataResponse {
$user = $this->userManager->get($userId);
if (!$user instanceof IUser) {
diff --git a/lib/Notifier/AdminNotifications.php b/lib/Notifier/AdminNotifications.php
index 76b27ae..1e63672 100644
--- a/lib/Notifier/AdminNotifications.php
+++ b/lib/Notifier/AdminNotifications.php
@@ -51,7 +51,7 @@ class AdminNotifications implements INotifier {
* @return INotification
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
*/
- public function prepare(INotification $notification, $languageCode) {
+ public function prepare(INotification $notification, $languageCode): INotification {
if ($notification->getApp() !== 'admin_notifications') {
throw new \InvalidArgumentException('Unknown app');
}