Skip to content

Commit 945fd36

Browse files
committed
Removed __construct from contracts
1 parent a41f195 commit 945fd36

File tree

4 files changed

+20
-46
lines changed

4 files changed

+20
-46
lines changed

src/Contracts/ArrayStore.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66

77
interface ArrayStore
88
{
9-
/**
10-
* Constructor
11-
*
12-
* @param array $data
13-
*/
14-
public function __construct(array $data = []);
15-
169
/**
1710
* Retrieve all the items.
1811
*

src/Contracts/Body/BodyRepository.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88

99
interface BodyRepository extends Stringable
1010
{
11-
/**
12-
* Constructor
13-
*
14-
* @param mixed $value
15-
*/
16-
public function __construct(mixed $value);
17-
1811
/**
1912
* Set a value inside the repository
2013
*

src/Contracts/PendingRequest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,6 @@ public function hasMockClient(): bool;
132132
*/
133133
public function query(): ArrayStore;
134134

135-
/**
136-
* Build up the request payload.
137-
*
138-
* @param \Saloon\Contracts\Connector $connector
139-
* @param Request $request
140-
* @param MockClient|null $mockClient
141-
*/
142-
public function __construct(Connector $connector, Request $request, MockClient $mockClient = null);
143-
144135
/**
145136
* Execute the response pipeline.
146137
*

src/Traits/OAuth2/AuthorizationCodeGrant.php

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use DateTimeImmutable;
88
use Saloon\Helpers\Date;
9-
use Saloon\Http\Response;
109
use Saloon\Helpers\URLHelper;
10+
use Saloon\Contracts\Response;
1111
use Saloon\Helpers\StateHelper;
1212
use Saloon\Helpers\OAuth2\OAuthConfig;
1313
use 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

Comments
 (0)