Browse Source

Strict controllers

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v16.0.0alpha1
Roeland Jago Douma 5 years ago
parent
commit
b9ac258870
No account linked to committer's email address

+ 3
- 2
apps/oauth2/lib/Controller/LoginRedirectorController.php View File

@@ -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) {

+ 3
- 13
apps/oauth2/lib/Controller/OauthApiController.php View File

@@ -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') {

Loading…
Cancel
Save