From d02394f8de0a14427348f5cfbc197b9e353ad1a7 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 16 Nov 2024 15:59:24 +0000 Subject: [PATCH] Added missing bits of documentation. --- src/OAuth2/OAuth2AuthorizationRequest.php | 30 +++++++++++++++++++++++ src/OAuth2/OAuth2Token.php | 27 ++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/src/OAuth2/OAuth2AuthorizationRequest.php b/src/OAuth2/OAuth2AuthorizationRequest.php index 6153fdd..285197d 100644 --- a/src/OAuth2/OAuth2AuthorizationRequest.php +++ b/src/OAuth2/OAuth2AuthorizationRequest.php @@ -26,26 +26,56 @@ final class OAuth2AuthorizationRequest { private readonly int $interval ) {} + /** + * Gets device code, meant to be sent to the server. + * + * @return string + */ public function getDeviceCode(): string { return $this->deviceCode; } + /** + * Gets user code, meant to be entered by the user. + * + * @return string + */ public function getUserCode(): string { return $this->userCode; } + /** + * Gets the verification page URI, without autofill. + * + * @return string + */ public function getVerificationUri(): string { return $this->verificationUri; } + /** + * Gets the verification page URI, with autofill. + * + * @return string + */ public function getVerificationUriComplete(): string { return $this->verificationUriComplete; } + /** + * Gets amount of seconds in which this authorisation requests will expire. + * + * @return int + */ public function getExpiresIn(): int { return $this->expiresIn; } + /** + * Gets amount of seconds at which interval we're meant to poll at. + * + * @return int + */ public function getInterval(): int { return $this->interval; } diff --git a/src/OAuth2/OAuth2Token.php b/src/OAuth2/OAuth2Token.php index 40a81ee..4c240b1 100644 --- a/src/OAuth2/OAuth2Token.php +++ b/src/OAuth2/OAuth2Token.php @@ -24,22 +24,49 @@ final class OAuth2Token { private readonly string $refreshToken ) {} + /** + * Gets OAuth2 access token. + * + * @return string + */ public function getAccessToken(): string { return $this->accessToken; } + /** + * Gets OAuth2 token type. + * + * Always 'Bearer' unless something crazy happens in the future. + * + * @return string + */ public function getTokenType(): string { return $this->tokenType; } + /** + * Gets amount of seconds in which the access token expires. + * + * @return int + */ public function getExpiresIn(): int { return $this->expiresIn; } + /** + * Gets possible alternate scope than what was initially requested by the application, empty if unchanged. + * + * @return string + */ public function getScope(): string { return $this->scope; } + /** + * Gets refresh token used to request a new access token. + * + * @return string + */ public function getRefreshToken(): string { return $this->refreshToken; }