1 | <?php |
||
29 | class AuthorizationServer implements EmitterAwareInterface |
||
30 | { |
||
31 | use EmitterAwareTrait; |
||
32 | |||
33 | /** |
||
34 | * @var GrantTypeInterface[] |
||
35 | */ |
||
36 | protected $enabledGrantTypes = []; |
||
37 | |||
38 | /** |
||
39 | * @var \DateInterval[] |
||
40 | */ |
||
41 | protected $grantTypeAccessTokenTTL = []; |
||
42 | |||
43 | /** |
||
44 | * @var CryptKey |
||
45 | */ |
||
46 | protected $privateKey; |
||
47 | |||
48 | /** |
||
49 | * @var CryptKey |
||
50 | */ |
||
51 | protected $publicKey; |
||
52 | |||
53 | /** |
||
54 | * @var null|ResponseTypeInterface |
||
55 | */ |
||
56 | protected $responseType; |
||
57 | |||
58 | /** |
||
59 | * @var ClientRepositoryInterface |
||
60 | */ |
||
61 | private $clientRepository; |
||
62 | |||
63 | /** |
||
64 | * @var AccessTokenRepositoryInterface |
||
65 | */ |
||
66 | private $accessTokenRepository; |
||
67 | |||
68 | /** |
||
69 | * @var ScopeRepositoryInterface |
||
70 | */ |
||
71 | private $scopeRepository; |
||
72 | |||
73 | /** |
||
74 | * @var string|Key |
||
75 | */ |
||
76 | private $encryptionKey; |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | */ |
||
81 | private $defaultScope = ''; |
||
82 | |||
83 | /** |
||
84 | * New server instance. |
||
85 | * |
||
86 | * @param ClientRepositoryInterface $clientRepository |
||
87 | * @param AccessTokenRepositoryInterface $accessTokenRepository |
||
88 | * @param ScopeRepositoryInterface $scopeRepository |
||
89 | * @param CryptKey|string $privateKey |
||
90 | * @param string|Key $encryptionKey |
||
91 | * @param null|ResponseTypeInterface $responseType |
||
92 | */ |
||
93 | 9 | public function __construct( |
|
112 | |||
113 | /** |
||
114 | * Enable a grant type on the server. |
||
115 | * |
||
116 | * @param GrantTypeInterface $grantType |
||
117 | * @param null|\DateInterval $accessTokenTTL |
||
118 | */ |
||
119 | 7 | public function enableGrantType(GrantTypeInterface $grantType, \DateInterval $accessTokenTTL = null) |
|
136 | |||
137 | /** |
||
138 | * Validate an authorization request |
||
139 | * |
||
140 | * @param ServerRequestInterface $request |
||
141 | * |
||
142 | * @throws OAuthServerException |
||
143 | * |
||
144 | * @return AuthorizationRequest |
||
145 | */ |
||
146 | 3 | public function validateAuthorizationRequest(ServerRequestInterface $request) |
|
156 | |||
157 | /** |
||
158 | * Complete an authorization request |
||
159 | * |
||
160 | * @param AuthorizationRequest $authRequest |
||
161 | * @param ResponseInterface $response |
||
162 | * |
||
163 | * @return ResponseInterface |
||
164 | */ |
||
165 | 1 | public function completeAuthorizationRequest(AuthorizationRequest $authRequest, ResponseInterface $response) |
|
171 | |||
172 | /** |
||
173 | * Return an access token response. |
||
174 | * |
||
175 | * @param ServerRequestInterface $request |
||
176 | * @param ResponseInterface $response |
||
177 | * |
||
178 | * @throws OAuthServerException |
||
179 | * |
||
180 | * @return ResponseInterface |
||
181 | */ |
||
182 | 4 | public function respondToAccessTokenRequest(ServerRequestInterface $request, ResponseInterface $response) |
|
201 | |||
202 | /** |
||
203 | * @param IntrospectionResponse $response |
||
|
|||
204 | */ |
||
205 | public function setIntrospectionReponseType(IntrospectionResponse $reponseType) |
||
209 | |||
210 | /** |
||
211 | * Get the introspection response |
||
212 | * |
||
213 | * @return ResponseTypeInterface |
||
214 | */ |
||
215 | protected function getIntrospectionResponseType() |
||
223 | |||
224 | /** |
||
225 | * Return an introspection response. |
||
226 | * |
||
227 | * @param ServerRequestInterface $request |
||
228 | * @param ResponseInterface $response |
||
229 | * |
||
230 | * @return ResponseInterface |
||
231 | */ |
||
232 | public function respondToIntrospectionRequest(ServerRequestInterface $request, ResponseInterface $response) |
||
242 | |||
243 | /** |
||
244 | * Get the token type that grants will return in the HTTP response. |
||
245 | * |
||
246 | * @return ResponseTypeInterface |
||
247 | */ |
||
248 | 4 | protected function getResponseType() |
|
261 | |||
262 | /** |
||
263 | * Set the default scope for the authorization server. |
||
264 | * |
||
265 | * @param string $defaultScope |
||
266 | */ |
||
267 | 3 | public function setDefaultScope($defaultScope) |
|
271 | } |
||
272 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.