Skip to content

Commit

Permalink
:octocat: stop the yelling
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jul 24, 2024
1 parent 4fe7a8d commit 8a64441
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/Providers/Spotify/SpotifyClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SpotifyClient extends Spotify{
protected string $market;
/** @var array<string, object> */
protected array $artists = [];
/** @var array<string, object> */
/** @var array<string, array<string, object>> */
protected array $albums = [];

protected function construct():void{
Expand Down
8 changes: 4 additions & 4 deletions src/Core/OAuth1Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{
protected string $requestTokenURL = '';

/**
* @param array<string, string> $params
* @param array<string, scalar>|null $params
*/
public function getAuthorizationURL(array|null $params = null, array|null $scopes = null):UriInterface{
$response = $this->sendRequestTokenRequest($this->requestTokenURL);
Expand Down Expand Up @@ -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<string, string> $params
* @param array<string, scalar> $params
*
* @throws \chillerlan\OAuth\Providers\ProviderException
*/
Expand Down Expand Up @@ -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<string, string> $params
* @param array<string, scalar> $params
*/
protected function setAuthorizationHeader(RequestInterface $request, array $params):RequestInterface{
return $request->withHeader('Authorization', sprintf('OAuth %s', QueryUtil::build($params, null, ', ', '"')));
Expand All @@ -242,7 +242,7 @@ protected function setAuthorizationHeader(RequestInterface $request, array $para
*
* @see \chillerlan\OAuth\Core\OAuth1Provider::getAccessToken()
*
* @param array<string, string> $headerParams
* @param array<string, scalar> $headerParams
*/
protected function sendAccessTokenRequest(array $headerParams):ResponseInterface{

Expand Down
22 changes: 11 additions & 11 deletions src/Core/OAuth2Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ abstract class OAuth2Provider extends OAuthProvider implements OAuth2Interface{
protected string $parAuthorizationURL = '';

/**
* @param array<string, string> $params
* @param string[] $scopes
* @param array<string, scalar>|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));
Expand All @@ -74,7 +74,7 @@ public function getAuthorizationURL(array|null $params = null, array|null $scope
*
* @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURL()
*
* @param array<string, string> $params
* @param array<string, scalar> $params
* @param string[] $scopes
*/
protected function getAuthorizationURLRequestParams(array $params, array $scopes):array{
Expand Down Expand Up @@ -236,7 +236,7 @@ protected function getAccessTokenRequestBodyParams(string $code):array{
* @see \chillerlan\OAuth\Core\OAuth2Provider::refreshAccessToken()
* @see \chillerlan\OAuth\Core\OAuth2Provider::getParRequestUri()
*
* @param array<string, string> $body
* @param array<string, scalar> $body
*/
protected function sendAccessTokenRequest(string $url, array $body):ResponseInterface{

Expand Down Expand Up @@ -340,7 +340,7 @@ protected function getClientCredentialsTokenRequestBodyParams(array|null $scopes
*
* @see \chillerlan\OAuth\Core\OAuth2Provider::getClientCredentialsToken()
*
* @param array<string, string> $body
* @param array<string, scalar> $body
*/
protected function sendClientCredentialsTokenRequest(string $url, array $body):ResponseInterface{

Expand Down Expand Up @@ -467,7 +467,7 @@ public function invalidateAccessToken(AccessToken|null $token = null, string|nul
*
* @see \chillerlan\OAuth\Core\OAuth2Provider::invalidateAccessToken()
*
* @param array<string, string> $body
* @param array<string, scalar> $body
*/
protected function sendTokenInvalidateRequest(string $url, array $body):ResponseInterface{

Expand Down Expand Up @@ -505,7 +505,7 @@ protected function getInvalidateAccessTokenBodyParams(AccessToken $token, string
* @see \chillerlan\OAuth\Core\CSRFToken::setState()
* @see \chillerlan\OAuth\Core\OAuth2Provider::getAuthorizationURLRequestParams()
*
* @param array<string, string> $params
* @param array<string, scalar> $params
* @throws \chillerlan\OAuth\Providers\ProviderException
*/
final public function setState(array $params):array{
Expand Down Expand Up @@ -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<string, string> $params
* @param array<string, scalar> $params
*/
final public function setCodeChallenge(array $params, string $challengeMethod):array{

Expand Down Expand Up @@ -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<string, string> $params
* @param array<string, scalar> $params
*/
final public function setCodeVerifier(array $params):array{

Expand Down Expand Up @@ -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<string, string> $body
* @param array<string, scalar> $body
*/
public function getParRequestUri(array $body):UriInterface{

Expand Down Expand Up @@ -704,7 +704,7 @@ public function getParRequestUri(array $body):UriInterface{
*
* @see \chillerlan\OAuth\Core\OAuth2Provider::getParRequestUri()
*
* @param array<string, string> $response
* @param array<string, scalar> $response
*
* @codeCoverageIgnore
*/
Expand Down
4 changes: 1 addition & 3 deletions src/Providers/LastFM.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ public function me():AuthenticatedUser{
*
* @link https://www.last.fm/api/show/track.scrobble
*
* @param array<string, scalar> $tracks
* @return array<string, scalar>
* @param array<string, scalar>|array<int, array<string, scalar>> $tracks
*/
public function scrobble(array $tracks):array{

Expand Down Expand Up @@ -416,7 +415,6 @@ protected function set_duration(int $duration):void{

/**
* @param array<string, string> $body
* @return array<string, mixed>|null
* @codeCoverageIgnore
*/
protected function sendScrobbles(array $body):array|null{
Expand Down
4 changes: 2 additions & 2 deletions src/Providers/Steam.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Steam extends OAuthProvider implements UserInfo{
*
* @inheritDoc
*
* @param array<string, string> $params
* @param string[] $scopes
* @param array<string, string>|null $params
* @param string[]|null $scopes
*/
public function getAuthorizationURL(array|null $params = null, array|null $scopes = null):UriInterface{

Expand Down

0 comments on commit 8a64441

Please sign in to comment.