From 8a64441419824789bf8d575761d028be487e7a89 Mon Sep 17 00:00:00 2001 From: smiley Date: Wed, 24 Jul 2024 12:46:15 +0200 Subject: [PATCH] :octocat: stop the yelling --- examples/Providers/Spotify/SpotifyClient.php | 2 +- src/Core/OAuth1Provider.php | 8 +++---- src/Core/OAuth2Provider.php | 22 ++++++++++---------- src/Providers/LastFM.php | 4 +--- src/Providers/Steam.php | 4 ++-- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/examples/Providers/Spotify/SpotifyClient.php b/examples/Providers/Spotify/SpotifyClient.php index 4e6d9cb..c1b52cc 100644 --- a/examples/Providers/Spotify/SpotifyClient.php +++ b/examples/Providers/Spotify/SpotifyClient.php @@ -24,7 +24,7 @@ class SpotifyClient extends Spotify{ protected string $market; /** @var array */ protected array $artists = []; - /** @var array */ + /** @var array> */ protected array $albums = []; protected function construct():void{ diff --git a/src/Core/OAuth1Provider.php b/src/Core/OAuth1Provider.php index 8747f90..a61d6e3 100644 --- a/src/Core/OAuth1Provider.php +++ b/src/Core/OAuth1Provider.php @@ -33,7 +33,7 @@ abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{ protected string $requestTokenURL = ''; /** - * @param array $params + * @param array|null $params */ public function getAuthorizationURL(array|null $params = null, array|null $scopes = null):UriInterface{ $response = $this->sendRequestTokenRequest($this->requestTokenURL); @@ -150,7 +150,7 @@ protected function parseTokenResponse(ResponseInterface $response, bool|null $ch * @see \chillerlan\OAuth\Core\OAuth1Provider::getRequestTokenRequestParams() * @see \chillerlan\OAuth\Core\OAuth1Provider::getRequestAuthorization() * - * @param array $params + * @param array $params * * @throws \chillerlan\OAuth\Providers\ProviderException */ @@ -231,7 +231,7 @@ protected function getAccessTokenRequestHeaderParams(AccessToken $requestToken, /** * Adds the "Authorization" header to the given `RequestInterface` using the given array or parameters * - * @param array $params + * @param array $params */ protected function setAuthorizationHeader(RequestInterface $request, array $params):RequestInterface{ return $request->withHeader('Authorization', sprintf('OAuth %s', QueryUtil::build($params, null, ', ', '"'))); @@ -242,7 +242,7 @@ protected function setAuthorizationHeader(RequestInterface $request, array $para * * @see \chillerlan\OAuth\Core\OAuth1Provider::getAccessToken() * - * @param array $headerParams + * @param array $headerParams */ protected function sendAccessTokenRequest(array $headerParams):ResponseInterface{ diff --git a/src/Core/OAuth2Provider.php b/src/Core/OAuth2Provider.php index 239e3e5..042060f 100644 --- a/src/Core/OAuth2Provider.php +++ b/src/Core/OAuth2Provider.php @@ -56,8 +56,8 @@ abstract class OAuth2Provider extends OAuthProvider implements OAuth2Interface{ protected string $parAuthorizationURL = ''; /** - * @param array $params - * @param string[] $scopes + * @param array|null $params + * @param string[]|null $scopes */ public function getAuthorizationURL(array|null $params = null, array|null $scopes = null):UriInterface{ $queryParams = $this->getAuthorizationURLRequestParams(($params ?? []), ($scopes ?? $this::DEFAULT_SCOPES)); @@ -74,7 +74,7 @@ public function getAuthorizationURL(array|null $params = null, array|null $scope * * @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURL() * - * @param array $params + * @param array $params * @param string[] $scopes */ protected function getAuthorizationURLRequestParams(array $params, array $scopes):array{ @@ -236,7 +236,7 @@ protected function getAccessTokenRequestBodyParams(string $code):array{ * @see \chillerlan\OAuth\Core\OAuth2Provider::refreshAccessToken() * @see \chillerlan\OAuth\Core\OAuth2Provider::getParRequestUri() * - * @param array $body + * @param array $body */ protected function sendAccessTokenRequest(string $url, array $body):ResponseInterface{ @@ -340,7 +340,7 @@ protected function getClientCredentialsTokenRequestBodyParams(array|null $scopes * * @see \chillerlan\OAuth\Core\OAuth2Provider::getClientCredentialsToken() * - * @param array $body + * @param array $body */ protected function sendClientCredentialsTokenRequest(string $url, array $body):ResponseInterface{ @@ -467,7 +467,7 @@ public function invalidateAccessToken(AccessToken|null $token = null, string|nul * * @see \chillerlan\OAuth\Core\OAuth2Provider::invalidateAccessToken() * - * @param array $body + * @param array $body */ protected function sendTokenInvalidateRequest(string $url, array $body):ResponseInterface{ @@ -505,7 +505,7 @@ protected function getInvalidateAccessTokenBodyParams(AccessToken $token, string * @see \chillerlan\OAuth\Core\CSRFToken::setState() * @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURLRequestParams() * - * @param array $params + * @param array $params * @throws \chillerlan\OAuth\Providers\ProviderException */ final public function setState(array $params):array{ @@ -562,7 +562,7 @@ final public function checkState(string|null $state = null):void{ * @see \chillerlan\OAuth\Core\PKCE::setCodeChallenge() * @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURLRequestParams() * - * @param array $params + * @param array $params */ final public function setCodeChallenge(array $params, string $challengeMethod):array{ @@ -590,7 +590,7 @@ final public function setCodeChallenge(array $params, string $challengeMethod):a * @see \chillerlan\OAuth\Core\PKCE::setCodeVerifier() * @see \chillerlan\OAuth\Core\OAuth2Provider::getAccessTokenRequestBodyParams() * - * @param array $params + * @param array $params */ final public function setCodeVerifier(array $params):array{ @@ -669,7 +669,7 @@ final public function generateChallenge(string $verifier, string $challengeMetho * @see \chillerlan\OAuth\Core\PAR::getParRequestUri() * @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURL() * - * @param array $body + * @param array $body */ public function getParRequestUri(array $body):UriInterface{ @@ -704,7 +704,7 @@ public function getParRequestUri(array $body):UriInterface{ * * @see \chillerlan\OAuth\Core\OAuth2Provider::getParRequestUri() * - * @param array $response + * @param array $response * * @codeCoverageIgnore */ diff --git a/src/Providers/LastFM.php b/src/Providers/LastFM.php index bc5102e..94c7719 100644 --- a/src/Providers/LastFM.php +++ b/src/Providers/LastFM.php @@ -276,8 +276,7 @@ public function me():AuthenticatedUser{ * * @link https://www.last.fm/api/show/track.scrobble * - * @param array $tracks - * @return array + * @param array|array> $tracks */ public function scrobble(array $tracks):array{ @@ -416,7 +415,6 @@ protected function set_duration(int $duration):void{ /** * @param array $body - * @return array|null * @codeCoverageIgnore */ protected function sendScrobbles(array $body):array|null{ diff --git a/src/Providers/Steam.php b/src/Providers/Steam.php index 707cfec..f23701f 100644 --- a/src/Providers/Steam.php +++ b/src/Providers/Steam.php @@ -39,8 +39,8 @@ class Steam extends OAuthProvider implements UserInfo{ * * @inheritDoc * - * @param array $params - * @param string[] $scopes + * @param array|null $params + * @param string[]|null $scopes */ public function getAuthorizationURL(array|null $params = null, array|null $scopes = null):UriInterface{