diff --git a/src/Provider/Discord.php b/src/Provider/Discord.php index 5611824..a868bad 100644 --- a/src/Provider/Discord.php +++ b/src/Provider/Discord.php @@ -14,6 +14,8 @@ namespace Wohali\OAuth2\Client\Provider; 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; @@ -44,7 +46,6 @@ public function getBaseAuthorizationUrl() * Get access token URL to retrieve token * * @param array $params - * * @return string */ public function getBaseAccessTokenUrl(array $params) @@ -56,7 +57,6 @@ public function getBaseAccessTokenUrl(array $params) * Get provider URL to retrieve user details * * @param AccessToken $token - * * @return string */ public function getResourceOwnerDetailsUrl(AccessToken $token) @@ -99,10 +99,11 @@ protected function getDefaultScopes() /** * Check a provider response for errors. * - * @throws IdentityProviderException - * @param ResponseInterface @response + * @param ResponseInterface $response * @param array $data Parsed response data * @return void + * + * @throws IdentityProviderException */ protected function checkResponse(ResponseInterface $response, $data) { @@ -114,9 +115,9 @@ protected function checkResponse(ResponseInterface $response, $data) /** * Generate a user object from a successful user details request. * - * @param array $response - * @param AccessToken $token - * @return \League\OAuth2\Client\Provider\ResourceOwnerInterface + * @param array $response + * @param AccessToken $token + * @return ResourceOwnerInterface */ protected function createResourceOwner(array $response, AccessToken $token) { diff --git a/src/Provider/DiscordResourceOwner.php b/src/Provider/DiscordResourceOwner.php index 549948c..f0933d7 100644 --- a/src/Provider/DiscordResourceOwner.php +++ b/src/Provider/DiscordResourceOwner.php @@ -30,7 +30,8 @@ class DiscordResourceOwner implements ResourceOwnerInterface /** * Creates new resource owner. * - * @param array $response + * @param array $response + * @return void */ public function __construct(array $response = array()) { diff --git a/src/Provider/Exception/DiscordIdentityProviderException.php b/src/Provider/Exception/DiscordIdentityProviderException.php index 5f690e8..979b78c 100644 --- a/src/Provider/Exception/DiscordIdentityProviderException.php +++ b/src/Provider/Exception/DiscordIdentityProviderException.php @@ -23,14 +23,13 @@ class DiscordIdentityProviderException extends IdentityProviderException * * @param ResponseInterface $response * @param array $data Parsed response data - * * @return IdentityProviderException */ public static function clientException(ResponseInterface $response, $data) { return static::fromResponse( $response, - isset($data['message']) ? $data['message'] : json_encode($data) + $data['message'] ?? json_encode($data) ); } @@ -39,7 +38,6 @@ public static function clientException(ResponseInterface $response, $data) * * @param ResponseInterface $response * @param string $message - * * @return IdentityProviderException */ protected static function fromResponse(ResponseInterface $response, $message = null)