1 | <?php |
||
26 | class AuthorizationServer implements EmitterAwareInterface |
||
27 | { |
||
28 | use EmitterAwareTrait; |
||
29 | |||
30 | /** |
||
31 | * @var \League\OAuth2\Server\Grant\GrantTypeInterface[] |
||
32 | */ |
||
33 | protected $enabledGrantTypes = []; |
||
34 | |||
35 | /** |
||
36 | * @var \DateInterval[] |
||
37 | */ |
||
38 | protected $grantTypeAccessTokenTTL = []; |
||
39 | |||
40 | /** |
||
41 | * @var \League\OAuth2\Server\CryptKey |
||
42 | */ |
||
43 | protected $privateKey; |
||
44 | |||
45 | /** |
||
46 | * @var \League\OAuth2\Server\CryptKey |
||
47 | */ |
||
48 | protected $publicKey; |
||
49 | |||
50 | /** |
||
51 | * @var ResponseTypeInterface |
||
52 | */ |
||
53 | protected $responseType; |
||
54 | |||
55 | /** |
||
56 | * @var \League\OAuth2\Server\Repositories\ClientRepositoryInterface |
||
57 | */ |
||
58 | private $clientRepository; |
||
59 | |||
60 | /** |
||
61 | * @var \League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface |
||
62 | */ |
||
63 | private $accessTokenRepository; |
||
64 | |||
65 | /** |
||
66 | * @var \League\OAuth2\Server\Repositories\ScopeRepositoryInterface |
||
67 | */ |
||
68 | private $scopeRepository; |
||
69 | |||
70 | /** |
||
71 | * New server instance. |
||
72 | * |
||
73 | * @param \League\OAuth2\Server\Repositories\ClientRepositoryInterface $clientRepository |
||
74 | * @param \League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface $accessTokenRepository |
||
75 | * @param \League\OAuth2\Server\Repositories\ScopeRepositoryInterface $scopeRepository |
||
76 | * @param \League\OAuth2\Server\CryptKey|string $privateKey |
||
77 | * @param \League\OAuth2\Server\CryptKey|string $publicKey |
||
78 | * @param null|\League\OAuth2\Server\ResponseTypes\ResponseTypeInterface $responseType |
||
79 | */ |
||
80 | public function __construct( |
||
104 | |||
105 | /** |
||
106 | * Enable a grant type on the server. |
||
107 | * |
||
108 | * @param \League\OAuth2\Server\Grant\GrantTypeInterface $grantType |
||
109 | * @param \DateInterval $accessTokenTTL |
||
110 | */ |
||
111 | public function enableGrantType(GrantTypeInterface $grantType, DateInterval $accessTokenTTL = null) |
||
127 | |||
128 | /** |
||
129 | * Validate an authorization request |
||
130 | * |
||
131 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
132 | * |
||
133 | * @throws \League\OAuth2\Server\Exception\OAuthServerException |
||
134 | * |
||
135 | * @return \League\OAuth2\Server\RequestTypes\AuthorizationRequest|null |
||
136 | */ |
||
137 | public function validateAuthorizationRequest(ServerRequestInterface $request) |
||
152 | |||
153 | /** |
||
154 | * Complete an authorization request |
||
155 | * |
||
156 | * @param \League\OAuth2\Server\RequestTypes\AuthorizationRequest $authRequest |
||
157 | * @param \Psr\Http\Message\ResponseInterface $response |
||
158 | * |
||
159 | * @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface |
||
160 | */ |
||
161 | public function completeAuthorizationRequest(AuthorizationRequest $authRequest, ResponseInterface $response) |
||
167 | |||
168 | /** |
||
169 | * Return an access token response. |
||
170 | * |
||
171 | * @param \Psr\Http\Message\ServerRequestInterface $request |
||
172 | * @param \Psr\Http\Message\ResponseInterface $response |
||
173 | * |
||
174 | * @throws \League\OAuth2\Server\Exception\OAuthServerException |
||
175 | * |
||
176 | * @return \Psr\Http\Message\ResponseInterface |
||
177 | */ |
||
178 | public function respondToAccessTokenRequest(ServerRequestInterface $request, ResponseInterface $response) |
||
198 | |||
199 | /** |
||
200 | * Get the token type that grants will return in the HTTP response. |
||
201 | * |
||
202 | * @return ResponseTypeInterface |
||
203 | */ |
||
204 | protected function getResponseType() |
||
214 | } |
||
215 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.