diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-07 13:43:22 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-07 13:43:22 +0100 |
commit | b9ac258870314a60ca5326d822ca404a19497e6c (patch) | |
tree | cdcf8f771db9d9a8f2bf6c68757b19a9fca79c94 /apps/oauth2/lib | |
parent | a47894576770cdb777ec433c2160cb60c0797457 (diff) | |
download | nextcloud-server-b9ac258870314a60ca5326d822ca404a19497e6c.tar.gz nextcloud-server-b9ac258870314a60ca5326d822ca404a19497e6c.zip |
Strict controllers
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/oauth2/lib')
-rw-r--r-- | apps/oauth2/lib/Controller/LoginRedirectorController.php | 5 | ||||
-rw-r--r-- | apps/oauth2/lib/Controller/OauthApiController.php | 16 |
2 files changed, 6 insertions, 15 deletions
diff --git a/apps/oauth2/lib/Controller/LoginRedirectorController.php b/apps/oauth2/lib/Controller/LoginRedirectorController.php index 8e8cff1b1a5..25154cbd4dc 100644 --- a/apps/oauth2/lib/Controller/LoginRedirectorController.php +++ b/apps/oauth2/lib/Controller/LoginRedirectorController.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch> * @@ -50,7 +51,7 @@ class LoginRedirectorController extends Controller { * @param ISession $session * @param IL10N $l */ - public function __construct($appName, + public function __construct(string $appName, IRequest $request, IURLGenerator $urlGenerator, ClientMapper $clientMapper, @@ -75,7 +76,7 @@ class LoginRedirectorController extends Controller { */ public function authorize($client_id, $state, - $response_type) { + $response_type): Response { try { $client = $this->clientMapper->getByIdentifier($client_id); } catch (ClientNotFoundException $e) { diff --git a/apps/oauth2/lib/Controller/OauthApiController.php b/apps/oauth2/lib/Controller/OauthApiController.php index 73fed3654d5..b05d3781e5c 100644 --- a/apps/oauth2/lib/Controller/OauthApiController.php +++ b/apps/oauth2/lib/Controller/OauthApiController.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2017 Lukas Reschke <lukas@statuscode.ch> * @@ -53,18 +54,7 @@ class OauthApiController extends Controller { /** @var Throttler */ private $throttler; - /** - * @param string $appName - * @param IRequest $request - * @param ICrypto $crypto - * @param AccessTokenMapper $accessTokenMapper - * @param ClientMapper $clientMapper - * @param TokenProvider $tokenProvider - * @param ISecureRandom $secureRandom - * @param ITimeFactory $time - * @param Throttler $throttler - */ - public function __construct($appName, + public function __construct(string $appName, IRequest $request, ICrypto $crypto, AccessTokenMapper $accessTokenMapper, @@ -94,7 +84,7 @@ class OauthApiController extends Controller { * @param string $client_secret * @return JSONResponse */ - public function getToken($grant_type, $code, $refresh_token, $client_id, $client_secret) { + public function getToken($grant_type, $code, $refresh_token, $client_id, $client_secret): JSONResponse { // We only handle two types if ($grant_type !== 'authorization_code' && $grant_type !== 'refresh_token') { |