1 | <?php |
||
29 | class ApiContainer extends Module implements UrlRuleCreator, BootstrapInterface |
||
30 | { |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $identityClass; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | public $versionUrlRuleClass = ModularUrlRule::class; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | public $containerUrlRuleClass = ModularUrlRule::class; |
||
45 | |||
46 | /** |
||
47 | * @inheritdoc |
||
48 | */ |
||
49 | public $defaultRoute = 'index'; |
||
50 | |||
51 | /** |
||
52 | * @inheritdoc |
||
53 | */ |
||
54 | public $controllerMap = ['index' => ApiContainerController::class]; |
||
55 | |||
56 | /** |
||
57 | * @var array |
||
58 | */ |
||
59 | public $versions = []; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | public $errorAction; |
||
65 | |||
66 | /** |
||
67 | * @var string the module id for the oauth2 server module. |
||
68 | */ |
||
69 | public $oauth2ModuleId = 'oauth2'; |
||
70 | |||
71 | /** |
||
72 | * @var array default OAuth2Module configuration. |
||
73 | */ |
||
74 | private $oauth2Module = [ |
||
75 | 'class' => OAuth2Module::class, |
||
76 | 'tokenParamName' => 'accessToken', |
||
77 | 'tokenAccessLifetime' => 3600 * 24, |
||
78 | 'storageMap' => [ |
||
79 | ], |
||
80 | 'grantTypes' => [ |
||
81 | 'user_credentials' => [ |
||
82 | 'class' => \OAuth2\GrantType\UserCredentials::class, |
||
83 | ], |
||
84 | 'refresh_token' => [ |
||
85 | 'class' => \OAuth2\GrantType\RefreshToken::class, |
||
86 | 'always_issue_new_refresh_token' => true |
||
87 | ], |
||
88 | ], |
||
89 | ]; |
||
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | public function behaviors() |
||
116 | |||
117 | /** |
||
118 | * @var array module |
||
119 | */ |
||
120 | public function setOauth2Module($module) |
||
138 | |||
139 | /** |
||
140 | * @return OAuth2Module |
||
141 | */ |
||
142 | public function getOauth2Module(): OAuth2Module |
||
152 | |||
153 | /** |
||
154 | * @inheritdoc |
||
155 | */ |
||
156 | public function bootstrap($app) |
||
170 | |||
171 | /** |
||
172 | * @return ApiVersion[] return all the versions attached to the container |
||
173 | * indexed by their respective id. |
||
174 | */ |
||
175 | public function getVersionModules(): array |
||
187 | |||
188 | /** |
||
189 | * @return \yii\web\UrlRuleInterface[] |
||
|
|||
190 | */ |
||
191 | protected function defaultUrlRules() |
||
201 | |||
202 | /** |
||
203 | * @inheritdoc |
||
204 | */ |
||
205 | public function createUrlRules(CompositeUrlRule $urlRule): array |
||
225 | |||
226 | /** |
||
227 | * @return string HTTP Url linking to this module |
||
228 | */ |
||
229 | public function getSelfLink(): string |
||
233 | } |
||
234 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.