@@ -58,6 +58,9 @@ |
||
| 58 | 58 | Yii::$app->session->set('identity:' . $this->id, $this); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @return IdentityInterface|null |
|
| 63 | + */ |
|
| 61 | 64 | public static function findOne($id) |
| 62 | 65 | { |
| 63 | 66 | if (isset(static::$_users[$id])) { |
@@ -78,8 +78,7 @@ |
||
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * Performs request to the API. |
| 81 | - * @param string $key |
|
| 82 | - * @param array $value |
|
| 81 | + * @param string $action |
|
| 83 | 82 | * @return array |
| 84 | 83 | */ |
| 85 | 84 | private function perform($action, $data) |
@@ -56,6 +56,10 @@ |
||
| 56 | 56 | return self::getList($name, $translate, array_merge($options, ['with_recursive' => true])); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $name |
|
| 61 | + * @param string|false $translate |
|
| 62 | + */ |
|
| 59 | 63 | public static function findCached($name, $translate = null, $options = []) |
| 60 | 64 | { |
| 61 | 65 | if ($translate === null) { |
@@ -81,6 +81,9 @@ discard block |
||
| 81 | 81 | return $this->checkActions($action) ?: $this->denyAccess($action); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | + /** |
|
| 85 | + * @param Action $action |
|
| 86 | + */ |
|
| 84 | 87 | protected function checkActions($action) |
| 85 | 88 | { |
| 86 | 89 | foreach ($this->actions as $names => $permissions) { |
@@ -134,8 +137,8 @@ discard block |
||
| 134 | 137 | * Denies the access of the user. |
| 135 | 138 | * The default implementation will redirect the user to the login page if he is a guest; |
| 136 | 139 | * if the user is already logged, a 403 HTTP exception will be thrown. |
| 137 | - * @param User|false $user the current user or boolean `false` in case of detached User component |
|
| 138 | 140 | * @throws ForbiddenHttpException if the user is already logged in or in case of detached User component |
| 141 | + * @param Action $action |
|
| 139 | 142 | */ |
| 140 | 143 | protected function denyAccess($action) |
| 141 | 144 | { |