From 8502fb84f950195556477e6ae5d70e760fad4bcf Mon Sep 17 00:00:00 2001 From: csabavirag Date: Tue, 19 Dec 2023 14:12:38 +0100 Subject: [PATCH] Remove deprecation warnings --- src/Grant/ArenaApiKey.php | 4 ++-- src/Provider/Arena.php | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Grant/ArenaApiKey.php b/src/Grant/ArenaApiKey.php index d865f45..c94be42 100644 --- a/src/Grant/ArenaApiKey.php +++ b/src/Grant/ArenaApiKey.php @@ -14,7 +14,7 @@ class ArenaApiKey extends AbstractGrant /** * @inheritdoc */ - protected function getName() + protected function getName(): string { return 'https://arena.uww.io/grants/api_key'; } @@ -22,7 +22,7 @@ protected function getName() /** * @inheritdoc */ - protected function getRequiredRequestParameters() + protected function getRequiredRequestParameters(): array { return [ 'api_key', diff --git a/src/Provider/Arena.php b/src/Provider/Arena.php index df68876..77f5698 100644 --- a/src/Provider/Arena.php +++ b/src/Provider/Arena.php @@ -8,6 +8,7 @@ use League\OAuth2\Client\Grant\GrantFactory; use League\OAuth2\Client\Provider\AbstractProvider; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; +use League\OAuth2\Client\Provider\ResourceOwnerInterface; use League\OAuth2\Client\Token\AccessToken; use League\OAuth2\Client\Tool\BearerAuthorizationTrait; use Psr\Http\Message\ResponseInterface; @@ -134,7 +135,7 @@ private function assertRequiredOptions(array $options) /** * @inheritdoc */ - public function getBaseAuthorizationUrl() + public function getBaseAuthorizationUrl(): string { // Not used return $this->baseUrl.'/oauth/v2/auth'; @@ -143,7 +144,7 @@ public function getBaseAuthorizationUrl() /** * @inheritdoc */ - public function getBaseAccessTokenUrl(array $params) + public function getBaseAccessTokenUrl(array $params): string { return $this->baseUrl.'/oauth/v2/token'; } @@ -151,7 +152,7 @@ public function getBaseAccessTokenUrl(array $params) /** * @inheritdoc */ - public function getResourceOwnerDetailsUrl(AccessToken $token) + public function getResourceOwnerDetailsUrl(AccessToken $token): string { return $this->baseUrl.'/api/json/profile'; } @@ -159,7 +160,7 @@ public function getResourceOwnerDetailsUrl(AccessToken $token) /** * @inheritdoc */ - public function getDefaultScopes() + public function getDefaultScopes(): array { return $this->scopes; } @@ -167,7 +168,7 @@ public function getDefaultScopes() /** * @inheritdoc */ - protected function getAccessTokenMethod() + protected function getAccessTokenMethod(): string { return $this->accessTokenMethod ?: parent::getAccessTokenMethod(); } @@ -175,7 +176,7 @@ protected function getAccessTokenMethod() /** * @inheritdoc */ - protected function getAccessTokenResourceOwnerId() + protected function getAccessTokenResourceOwnerId(): ?string { return $this->accessTokenResourceOwnerId ?: parent::getAccessTokenResourceOwnerId(); } @@ -183,7 +184,7 @@ protected function getAccessTokenResourceOwnerId() /** * @inheritdoc */ - protected function checkResponse(ResponseInterface $response, $data) + protected function checkResponse(ResponseInterface $response, $data): void { if (!empty($data[$this->responseError])) { $error = $data[$this->responseError]; @@ -201,7 +202,7 @@ protected function checkResponse(ResponseInterface $response, $data) /** * @inheritdoc */ - protected function createResourceOwner(array $response, AccessToken $token) + protected function createResourceOwner(array $response, AccessToken $token): ResourceOwnerInterface { return new ArenaResourceOwner($response, $this->responseResourceOwnerId); }