diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index 694e270..3279a01 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -64,7 +64,7 @@ public function __construct( } } - public function getIdentifier() + public function getIdentifier(): string { return 'authorization_code_oidc'; } @@ -72,7 +72,7 @@ public function getIdentifier() /** * {@inheritdoc} */ - public function canRespondToAuthorizationRequest(ServerRequestInterface $request) + public function canRespondToAuthorizationRequest(ServerRequestInterface $request): bool { $result = parent::canRespondToAuthorizationRequest($request); @@ -84,7 +84,7 @@ public function canRespondToAuthorizationRequest(ServerRequestInterface $request return $result; } - public function canRespondToAccessTokenRequest(ServerRequestInterface $request) + public function canRespondToAccessTokenRequest(ServerRequestInterface $request): bool { $requestParameters = (array) $request->getParsedBody(); @@ -112,7 +112,7 @@ public function canRespondToAccessTokenRequest(ServerRequestInterface $request) /** * {@inheritdoc} */ - public function validateAuthorizationRequest(ServerRequestInterface $request) + public function validateAuthorizationRequest(ServerRequestInterface $request): AuthorizationRequest { $result = parent::validateAuthorizationRequest($request); @@ -172,7 +172,7 @@ public function respondToAccessTokenRequest( ServerRequestInterface $request, ResponseTypeInterface $responseType, \DateInterval $accessTokenTTL - ) { + ): ResponseTypeInterface { /** * @var BearerTokenResponse $result */ @@ -238,7 +238,7 @@ protected function makeIdTokenInstance() /** * {@inheritdoc} */ - public function completeAuthorizationRequest(AuthorizationRequest $authorizationRequest) + public function completeAuthorizationRequest(AuthorizationRequest $authorizationRequest): ResponseTypeInterface { if (!($authorizationRequest instanceof AuthenticationRequest)) { throw OAuthServerException::invalidRequest('not possible'); diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index 9068342..d4c93ea 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -13,6 +13,7 @@ use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; use League\OAuth2\Server\RequestTypes\AuthorizationRequest; use League\OAuth2\Server\ResponseTypes\RedirectResponse; +use League\OAuth2\Server\ResponseTypes\ResponseTypeInterface; use Psr\Http\Message\ServerRequestInterface; class ImplicitGrant extends \League\OAuth2\Server\Grant\ImplicitGrant @@ -64,12 +65,12 @@ public function __construct( $this->queryDelimiter = $queryDelimiter; } - public function getIdentifier() + public function getIdentifier(): string { return 'implicit_oidc'; } - public function canRespondToAuthorizationRequest(ServerRequestInterface $request) + public function canRespondToAuthorizationRequest(ServerRequestInterface $request): bool { $result = (isset($request->getQueryParams()['response_type']) && ( @@ -85,7 +86,7 @@ public function canRespondToAuthorizationRequest(ServerRequestInterface $request return $result && ($scopes && in_array('openid', explode(' ', $scopes))); } - public function validateAuthorizationRequest(ServerRequestInterface $request) + public function validateAuthorizationRequest(ServerRequestInterface $request): AuthorizationRequest { $result = parent::validateAuthorizationRequest($request); @@ -142,7 +143,7 @@ public function validateAuthorizationRequest(ServerRequestInterface $request) return $result; } - public function completeAuthorizationRequest(AuthorizationRequest $authorizationRequest) + public function completeAuthorizationRequest(AuthorizationRequest $authorizationRequest): ResponseTypeInterface { if (!($authorizationRequest instanceof AuthenticationRequest)) { throw OAuthServerException::invalidRequest('not possible'); diff --git a/src/ResponseTypes/BearerTokenResponse.php b/src/ResponseTypes/BearerTokenResponse.php index b296364..6f131fa 100644 --- a/src/ResponseTypes/BearerTokenResponse.php +++ b/src/ResponseTypes/BearerTokenResponse.php @@ -27,7 +27,7 @@ public function getAccessToken() return $this->accessToken; } - protected function getExtraParams(AccessTokenEntityInterface $accessToken) + protected function getExtraParams(AccessTokenEntityInterface $accessToken): array { /* The Claims requested by the profile, email, address, and phone scope values