diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Federation/ICloudId.php | 9 | ||||
-rw-r--r-- | lib/public/Federation/ICloudIdManager.php | 7 | ||||
-rw-r--r-- | lib/public/Http/Client/IClient.php | 13 | ||||
-rw-r--r-- | lib/public/Http/Client/IClientService.php | 3 | ||||
-rw-r--r-- | lib/public/Http/Client/IResponse.php | 9 | ||||
-rw-r--r-- | lib/public/User.php | 25 |
6 files changed, 24 insertions, 42 deletions
diff --git a/lib/public/Federation/ICloudId.php b/lib/public/Federation/ICloudId.php index b03acb4f5f2..6cc17984f96 100644 --- a/lib/public/Federation/ICloudId.php +++ b/lib/public/Federation/ICloudId.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2017, Robin Appelman <robin@icewind.nl> * @@ -35,7 +36,7 @@ interface ICloudId { * @return string * @since 12.0.0 */ - public function getId(); + public function getId(): string; /** * Get a clean representation of the cloud id for display @@ -43,7 +44,7 @@ interface ICloudId { * @return string * @since 12.0.0 */ - public function getDisplayId(); + public function getDisplayId(): string; /** * The username on the remote server @@ -51,7 +52,7 @@ interface ICloudId { * @return string * @since 12.0.0 */ - public function getUser(); + public function getUser(): string; /** * The base address of the remote server @@ -59,5 +60,5 @@ interface ICloudId { * @return string * @since 12.0.0 */ - public function getRemote(); + public function getRemote(): string; } diff --git a/lib/public/Federation/ICloudIdManager.php b/lib/public/Federation/ICloudIdManager.php index b5b3436e6fc..c139cfda6cd 100644 --- a/lib/public/Federation/ICloudIdManager.php +++ b/lib/public/Federation/ICloudIdManager.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2017, Robin Appelman <robin@icewind.nl> * @@ -37,7 +38,7 @@ interface ICloudIdManager { * * @since 12.0.0 */ - public function resolveCloudId($cloudId); + public function resolveCloudId(string $cloudId): ICloudId; /** * Get the cloud id for a remote user @@ -48,7 +49,7 @@ interface ICloudIdManager { * * @since 12.0.0 */ - public function getCloudId($user, $remote); + public function getCloudId(string $user, string $remote): ICloudId; /** * Check if the input is a correctly formatted cloud id @@ -58,5 +59,5 @@ interface ICloudIdManager { * * @since 12.0.0 */ - public function isValidCloudId($cloudId); + public function isValidCloudId(string $cloudId): bool; } diff --git a/lib/public/Http/Client/IClient.php b/lib/public/Http/Client/IClient.php index 49e679a7ade..50addc230eb 100644 --- a/lib/public/Http/Client/IClient.php +++ b/lib/public/Http/Client/IClient.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -59,7 +60,7 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function get($uri, array $options = []); + public function get(string $uri, array $options = []): IResponse; /** * Sends a HEAD request @@ -84,7 +85,7 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function head($uri, $options = []); + public function head(string $uri, array $options = []): IResponse; /** * Sends a POST request @@ -114,7 +115,7 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function post($uri, array $options = []); + public function post(string $uri, array $options = []): IResponse; /** * Sends a PUT request @@ -144,7 +145,7 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function put($uri, array $options = []); + public function put(string $uri, array $options = []): IResponse; /** * Sends a DELETE request @@ -174,7 +175,7 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function delete($uri, array $options = []); + public function delete(string $uri, array $options = []): IResponse; /** * Sends a options request @@ -204,5 +205,5 @@ interface IClient { * @throws \Exception If the request could not get completed * @since 8.1.0 */ - public function options($uri, array $options = []); + public function options(string $uri, array $options = []): IResponse; } diff --git a/lib/public/Http/Client/IClientService.php b/lib/public/Http/Client/IClientService.php index 09a1f1f7b40..d34302744e1 100644 --- a/lib/public/Http/Client/IClientService.php +++ b/lib/public/Http/Client/IClientService.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -34,5 +35,5 @@ interface IClientService { * @return IClient * @since 8.1.0 */ - public function newClient(); + public function newClient(): IClient; } diff --git a/lib/public/Http/Client/IResponse.php b/lib/public/Http/Client/IResponse.php index 94817f012b3..e935067d8c2 100644 --- a/lib/public/Http/Client/IResponse.php +++ b/lib/public/Http/Client/IResponse.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -41,18 +42,18 @@ interface IResponse { * @return int * @since 8.1.0 */ - public function getStatusCode(); + public function getStatusCode(): int; /** - * @param $key + * @param string $key * @return string * @since 8.1.0 */ - public function getHeader($key); + public function getHeader(string $key): string; /** * @return array * @since 8.1.0 */ - public function getHeaders(); + public function getHeaders(): array; } diff --git a/lib/public/User.php b/lib/public/User.php index fd39b103d65..2fdf540b958 100644 --- a/lib/public/User.php +++ b/lib/public/User.php @@ -115,30 +115,7 @@ class User { * @since 5.0.0 */ public static function userExists($uid, $excludingBackend = null) { - return \OC_User::userExists($uid); - } - /** - * Logs the user out including all the session data - * Logout, destroys session - * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout(); - * @since 5.0.0 - */ - public static function logout() { - \OC::$server->getUserSession()->logout(); - } - - /** - * Check if the password is correct - * @param string $uid The username - * @param string $password The password - * @return string|false username on success, false otherwise - * - * Check if the password is correct without logging in the user - * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword(); - * @since 5.0.0 - */ - public static function checkPassword( $uid, $password ) { - return \OC_User::checkPassword( $uid, $password ); + return \OC::$server->getUserManager()->userExists($uid); } /** |