Skip to content

Commit

Permalink
Remove deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
csabavirag committed Dec 19, 2023
1 parent 2afc140 commit 8502fb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Grant/ArenaApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class ArenaApiKey extends AbstractGrant
/**
* @inheritdoc
*/
protected function getName()
protected function getName(): string
{
return 'https://arena.uww.io/grants/api_key';
}

/**
* @inheritdoc
*/
protected function getRequiredRequestParameters()
protected function getRequiredRequestParameters(): array
{
return [
'api_key',
Expand Down
17 changes: 9 additions & 8 deletions src/Provider/Arena.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand All @@ -143,47 +144,47 @@ public function getBaseAuthorizationUrl()
/**
* @inheritdoc
*/
public function getBaseAccessTokenUrl(array $params)
public function getBaseAccessTokenUrl(array $params): string
{
return $this->baseUrl.'/oauth/v2/token';
}

/**
* @inheritdoc
*/
public function getResourceOwnerDetailsUrl(AccessToken $token)
public function getResourceOwnerDetailsUrl(AccessToken $token): string
{
return $this->baseUrl.'/api/json/profile';
}

/**
* @inheritdoc
*/
public function getDefaultScopes()
public function getDefaultScopes(): array
{
return $this->scopes;
}

/**
* @inheritdoc
*/
protected function getAccessTokenMethod()
protected function getAccessTokenMethod(): string
{
return $this->accessTokenMethod ?: parent::getAccessTokenMethod();
}

/**
* @inheritdoc
*/
protected function getAccessTokenResourceOwnerId()
protected function getAccessTokenResourceOwnerId(): ?string
{
return $this->accessTokenResourceOwnerId ?: parent::getAccessTokenResourceOwnerId();
}

/**
* @inheritdoc
*/
protected function checkResponse(ResponseInterface $response, $data)
protected function checkResponse(ResponseInterface $response, $data): void
{
if (!empty($data[$this->responseError])) {
$error = $data[$this->responseError];
Expand All @@ -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);
}
Expand Down

0 comments on commit 8502fb8

Please sign in to comment.