@@ -106,7 +106,7 @@ |
||
106 | 106 | * Response constructor. |
107 | 107 | * @param string $accessToken |
108 | 108 | * @param string $tokenType |
109 | - * @param int|null $expiresIn |
|
109 | + * @param integer $expiresIn |
|
110 | 110 | * @param null|string $refreshToken |
111 | 111 | * @param null|string $scope |
112 | 112 | */ |
@@ -96,7 +96,7 @@ |
||
96 | 96 | /** |
97 | 97 | * Renvoie une réponse si une erreur survient, null sinon, le client et la redirect_uri sont des parametres int/out |
98 | 98 | * @param ServerRequestInterface $request |
99 | - * @param void $client |
|
99 | + * @param RegisteredClient $client |
|
100 | 100 | * @param void $responseTypes |
101 | 101 | * @param void $redirectUri |
102 | 102 | * @param void $scope |
@@ -68,7 +68,7 @@ |
||
68 | 68 | /** |
69 | 69 | * Server constructor. |
70 | 70 | * @param ResourceOwnerProviderInterface $resourceOwnerProvider |
71 | - * @param null|StorageRepository $storageRepository |
|
71 | + * @param StorageRepository $storageRepository |
|
72 | 72 | * @param null|ConfigurationRepository $configurationRepository |
73 | 73 | * @param ResponseTypeRepository $responseTypeRepository |
74 | 74 | * @param null|GrantTypeRepository $grantTypeRepository |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * method available via the user-agent to accomplish this redirection is |
43 | 43 | * allowed and is considered to be an implementation detail |
44 | 44 | * |
45 | - * @param $uri |
|
45 | + * @param string $uri |
|
46 | 46 | * @return Response |
47 | 47 | */ |
48 | 48 | protected function redirectResponse($uri) |
@@ -274,7 +274,7 @@ |
||
274 | 274 | * @param RegisteredClient $client |
275 | 275 | * @param null|string $redirectUri |
276 | 276 | * @param bool $isImplicitGrant |
277 | - * @return Uri|null|string |
|
277 | + * @return \Psr\Http\Message\UriInterface |
|
278 | 278 | * @throws \Exception |
279 | 279 | */ |
280 | 280 | private function checkClientRedirectUri(RegisteredClient $client, ?string $redirectUri, $isImplicitGrant = false) |
@@ -238,8 +238,7 @@ |
||
238 | 238 | |
239 | 239 | if($isImplicitResponseType) { |
240 | 240 | $redirectUri = $redirectUri->withFragment(http_build_query($params)); |
241 | - } |
|
242 | - else { |
|
241 | + } else { |
|
243 | 242 | foreach ($params as $key => $value) { |
244 | 243 | $redirectUri = Uri::withQueryValue($redirectUri, $key, $value); |
245 | 244 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | * @param UriInterface $redirectUri |
116 | 116 | * @param string $accessToken |
117 | 117 | * @param string $tokenType |
118 | - * @param int|null $expiresIn |
|
118 | + * @param integer $expiresIn |
|
119 | 119 | * @param null|string $refreshToken |
120 | 120 | * @param null|string $scope |
121 | 121 | */ |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | /** |
143 | 143 | * @param string $name |
144 | - * @return mixed |
|
144 | + * @return boolean |
|
145 | 145 | * @throws \Exception |
146 | 146 | */ |
147 | 147 | public function getConfig(string $name) |
@@ -161,6 +161,9 @@ discard block |
||
161 | 161 | return $this->grantTypes[$uri] ?? null; |
162 | 162 | } |
163 | 163 | |
164 | + /** |
|
165 | + * @return \OAuth2\Storages\AuthorizationCodeStorageInterface |
|
166 | + */ |
|
164 | 167 | public function getStorage(string $name) |
165 | 168 | { |
166 | 169 | return $this->storages[$name]; |
@@ -166,8 +166,7 @@ |
||
166 | 166 | |
167 | 167 | try { |
168 | 168 | $redirectUri = $grantType->grant($request, $client); |
169 | - } |
|
170 | - catch(InvalidGrantType $e) { |
|
169 | + } catch(InvalidGrantType $e) { |
|
171 | 170 | return new ErrorResponse('invalid_grant', $e->getErrorDescription(), $e->getErrorUri()); |
172 | 171 | } |
173 | 172 |
@@ -75,8 +75,7 @@ |
||
75 | 75 | |
76 | 76 | if(empty($responseTypes)) { |
77 | 77 | throw new OAuthException('invalid_request', 'Invalid response_type parameter'); |
78 | - } |
|
79 | - else if (count($responseTypes) == 1) { |
|
78 | + } else if (count($responseTypes) == 1) { |
|
80 | 79 | $defaultResponseMode = $responseTypes[0]->getDefaultResponseMode(); |
81 | 80 | } else { |
82 | 81 | $defaultResponseMode = ResponseTypeInterface::RESPONSE_MODE_FRAGMENT; |