]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add return type hint to credential store and make it strict 18108/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 25 Nov 2019 14:59:55 +0000 (15:59 +0100)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 25 Nov 2019 14:59:55 +0000 (15:59 +0100)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/Authentication/LoginCredentials/Store.php
lib/public/Authentication/LoginCredentials/IStore.php

index 0ed19a2dd07e3c24b84f0de09dfb73c4b412aed8..5f8be9b769f586db74e9f9115e7d14eebd00dc3d 100644 (file)
@@ -1,4 +1,5 @@
-<?php
+<?php declare(strict_types=1);
+
 /**
  * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
  *
@@ -82,8 +83,8 @@ class Store implements IStore {
         * @return ICredentials the login credentials of the current user
         * @throws CredentialsUnavailableException
         */
-       public function getLoginCredentials() {
-               if (is_null($this->tokenProvider)) {
+       public function getLoginCredentials(): ICredentials {
+               if ($this->tokenProvider === null) {
                        throw new CredentialsUnavailableException();
                }
 
index 5306eb6d6e9fc6e4b52f7bf0fd43729572445c79..054e6d856466e58b6e93cb6a55c0316d7ddcd7c0 100644 (file)
@@ -1,4 +1,5 @@
-<?php
+<?php declare(strict_types=1);
+
 /**
  * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
  *
@@ -29,7 +30,7 @@ use OCP\Authentication\Exceptions\CredentialsUnavailableException;
  * @since 12
  */
 interface IStore {
-       
+
        /**
         * Get login credentials of the currently logged in user
         *
@@ -38,6 +39,6 @@ interface IStore {
         * @throws CredentialsUnavailableException
         * @return ICredentials the login credentials of the current user
         */
-       public function getLoginCredentials();
-       
+       public function getLoginCredentials(): ICredentials;
+
 }