1 | <?php |
||
13 | class AuthorizationServerConfigurationBuilder |
||
14 | { |
||
15 | private $defaultOptions = [ |
||
16 | 'client_storage' => null, |
||
17 | 'access_token_storage' => null, |
||
18 | 'refresh_token_storage' => null, |
||
19 | 'access_token_generator' => null, |
||
20 | 'always_require_a_client' => false, |
||
21 | 'access_token_length' => 32, |
||
22 | 'access_token_ttl' => 3600, |
||
23 | 'always_generate_a_refresh_token' => false, |
||
24 | 'revoke_refresh_token_when_used' => true, |
||
25 | 'grant_types' => [] |
||
26 | ]; |
||
27 | |||
28 | private $options = [ |
||
29 | 'client_storage' => null, |
||
30 | 'access_token_storage' => null, |
||
31 | 'refresh_token_storage' => null, |
||
32 | 'access_token_generator' => null, |
||
33 | 'always_require_a_client' => false, |
||
34 | 'access_token_length' => 32, |
||
35 | 'access_token_ttl' => 3600, |
||
36 | 'always_generate_a_refresh_token' => false, |
||
37 | 'revoke_refresh_token_when_used' => true, |
||
38 | 'grant_types' => [] |
||
39 | ]; |
||
40 | |||
41 | private $built = false; |
||
42 | |||
43 | private $configuration; |
||
44 | |||
45 | public function __construct() |
||
48 | |||
49 | public function setClientStorage(ClientStorage $clientStorage) |
||
55 | |||
56 | public function setAccessTokenStorage(AccessTokenStorage $clientStorage) |
||
62 | |||
63 | public function setRefreshStorage(RefreshTokenStorage $clientStorage) |
||
69 | |||
70 | public function alwaysRequireAClient($flag) |
||
76 | |||
77 | public function shouldRevokeRefreshTokenWhenUsed($flag) |
||
83 | |||
84 | public function alwaysGenerateARefreshToken($flag) |
||
90 | |||
91 | public function setAccessTokenTTL($ttlInSeconds) |
||
98 | |||
99 | public function setAccessTokenGenerator($accessTokenGenerator) |
||
105 | |||
106 | public function addGrantType(GrantType $grantType, $overrideExisting = false) |
||
120 | |||
121 | public function build() |
||
154 | |||
155 | public function reset() |
||
161 | |||
162 | public function getAuthorizationServerConfiguration() |
||
171 | } |
||
172 |
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.