66
77use DateTimeImmutable ;
88use Saloon \Helpers \Date ;
9- use Saloon \Http \Response ;
109use Saloon \Helpers \URLHelper ;
10+ use Saloon \Contracts \Response ;
1111use Saloon \Helpers \StateHelper ;
1212use Saloon \Helpers \OAuth2 \OAuthConfig ;
1313use Saloon \Http \OAuth2 \GetUserRequest ;
@@ -57,10 +57,10 @@ protected function defaultOauthConfig(): OAuthConfig
5757 * Get the Authorization URL.
5858 *
5959 * @param array $scopes
60- * @param string $scopeSeparator
6160 * @param string|null $state
61+ * @param string $scopeSeparator
6262 * @return string
63- * @throws \Sammyjo20\ Saloon\Exceptions\OAuthConfigValidationException
63+ * @throws \Saloon\Exceptions\OAuthConfigValidationException
6464 */
6565 public function getAuthorizationUrl (array $ scopes = [], string $ state = null , string $ scopeSeparator = ' ' ): string
6666 {
@@ -99,13 +99,12 @@ public function getAuthorizationUrl(array $scopes = [], string $state = null, st
9999 * @param string|null $state
100100 * @param string|null $expectedState
101101 * @param bool $returnResponse
102- * @return OAuthAuthenticator|Response
103- * @throws InvalidStateException
104- * @throws \JsonException
102+ * @return \Saloon\Contracts\OAuthAuthenticator|\Saloon\Contracts\Response
105103 * @throws \ReflectionException
106- * @throws \Sammyjo20\Saloon\Exceptions\OAuthConfigValidationException
107- * @throws \Sammyjo20\Saloon\Exceptions\SaloonException
108- * @throws \Sammyjo20\Saloon\Exceptions\SaloonRequestException
104+ * @throws \Saloon\Exceptions\InvalidResponseClassException
105+ * @throws \Saloon\Exceptions\InvalidStateException
106+ * @throws \Saloon\Exceptions\OAuthConfigValidationException
107+ * @throws \Saloon\Exceptions\PendingRequestException
109108 */
110109 public function getAccessToken (string $ code , string $ state = null , string $ expectedState = null , bool $ returnResponse = false ): OAuthAuthenticator |Response
111110 {
@@ -129,14 +128,13 @@ public function getAccessToken(string $code, string $state = null, string $expec
129128 /**
130129 * Refresh the access token.
131130 *
132- * @param OAuthAuthenticator|string $refreshToken
131+ * @param \Saloon\Contracts\ OAuthAuthenticator|string $refreshToken
133132 * @param bool $returnResponse
134- * @return OAuthAuthenticator|Response
135- * @throws \GuzzleHttp\Exception\GuzzleException
133+ * @return \Saloon\Contracts\OAuthAuthenticator|\Saloon\Contracts\Response
136134 * @throws \ReflectionException
137- * @throws \Sammyjo20\ Saloon\Exceptions\OAuthConfigValidationException
138- * @throws \Sammyjo20\ Saloon\Exceptions\SaloonException
139- * @throws \Sammyjo20\ Saloon\Exceptions\SaloonRequestException
135+ * @throws \Saloon\Exceptions\InvalidResponseClassException
136+ * @throws \Saloon\Exceptions\OAuthConfigValidationException
137+ * @throws \Saloon\Exceptions\PendingRequestException
140138 */
141139 public function refreshAccessToken (OAuthAuthenticator |string $ refreshToken , bool $ returnResponse = false ): OAuthAuthenticator |Response
142140 {
@@ -160,10 +158,9 @@ public function refreshAccessToken(OAuthAuthenticator|string $refreshToken, bool
160158 /**
161159 * Create the OAuthAuthenticator from a response.
162160 *
163- * @param Response $response
161+ * @param \Saloon\Contracts\ Response $response
164162 * @param string|null $fallbackRefreshToken
165- * @return OAuthAuthenticator
166- * @throws \JsonException
163+ * @return \Saloon\Contracts\OAuthAuthenticator
167164 */
168165 protected function createOAuthAuthenticatorFromResponse (Response $ response , string $ fallbackRefreshToken = null ): OAuthAuthenticator
169166 {
@@ -190,13 +187,13 @@ protected function createOAuthAuthenticator(string $accessToken, string $refresh
190187 }
191188
192189 /**
193- * Get the authenticated user.s
190+ * Get the authenticated user.
194191 *
195- * @param OAuthAuthenticator $oauthAuthenticator
196- * @return Response
197- * @throws \GuzzleHttp\Exception\GuzzleException
192+ * @param \Saloon\Contracts\OAuthAuthenticator $oauthAuthenticator
193+ * @return \Saloon\Contracts\Response
198194 * @throws \ReflectionException
199- * @throws \Sammyjo20\Saloon\Exceptions\SaloonException
195+ * @throws \Saloon\Exceptions\InvalidResponseClassException
196+ * @throws \Saloon\Exceptions\PendingRequestException
200197 */
201198 public function getUser (OAuthAuthenticator $ oauthAuthenticator ): Response
202199 {
0 commit comments