@@ -51,6 +51,10 @@ |
||
51 | 51 | return ArrayHelper::map($models, $from, $to, $group); |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $name |
|
56 | + * @param string $translate |
|
57 | + */ |
|
54 | 58 | public static function findCached($name, $translate = null, $options = []) |
55 | 59 | { |
56 | 60 | if ($translate === null) { |
@@ -21,11 +21,17 @@ |
||
21 | 21 | |
22 | 22 | public $options = []; |
23 | 23 | |
24 | + /** |
|
25 | + * @param string $name |
|
26 | + */ |
|
24 | 27 | public static function i($name, $params = []) |
25 | 28 | { |
26 | 29 | return self::build('i', $name, $params); |
27 | 30 | } |
28 | 31 | |
32 | + /** |
|
33 | + * @param string $tag |
|
34 | + */ |
|
29 | 35 | public static function build($tag, $name, $params = []) |
30 | 36 | { |
31 | 37 | $class = get_called_class(); |
@@ -19,6 +19,9 @@ |
||
19 | 19 | private $module; |
20 | 20 | private $controller; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $controller |
|
24 | + */ |
|
22 | 25 | public function __construct($module, $controller) |
23 | 26 | { |
24 | 27 | $this->module = $module; |
@@ -14,7 +14,6 @@ |
||
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @param GridLegendInterface $legendItem |
17 | - * @param array $config |
|
18 | 17 | * @return self |
19 | 18 | */ |
20 | 19 | public static function create(GridLegendInterface $legendItem) |
@@ -66,6 +66,9 @@ |
||
66 | 66 | return $label; |
67 | 67 | } |
68 | 68 | |
69 | + /** |
|
70 | + * @param string $key |
|
71 | + */ |
|
69 | 72 | public function getValue($key) |
70 | 73 | { |
71 | 74 | if (isset($this->knownClasses[$this->className][$key])) { |
@@ -11,7 +11,6 @@ |
||
11 | 11 | namespace hipanel\widgets\obj; |
12 | 12 | |
13 | 13 | use hipanel\models\Obj; |
14 | -use Yii; |
|
15 | 14 | use yii\helpers\Html; |
16 | 15 | |
17 | 16 | class ObjLinkWidget extends \yii\base\Widget |
@@ -40,6 +40,9 @@ |
||
40 | 40 | $this->_label = $label; |
41 | 41 | } |
42 | 42 | |
43 | + /** |
|
44 | + * @return string |
|
45 | + */ |
|
43 | 46 | public function getLabel() |
44 | 47 | { |
45 | 48 | if ($this->_label === null) { |
@@ -62,13 +62,16 @@ discard block |
||
62 | 62 | * This method is invoked right before an action is to be executed (after all possible filters.) |
63 | 63 | * You may override this method to do last-minute preparation for the action. |
64 | 64 | * @param Action $action the action to be executed. |
65 | - * @return bool whether the action execution should be continued. |
|
65 | + * @return null|boolean whether the action execution should be continued. |
|
66 | 66 | */ |
67 | 67 | public function beforeAction($action) |
68 | 68 | { |
69 | 69 | return $this->checkActions($action) ?: $this->denyAccess($action); |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param Action $action |
|
74 | + */ |
|
72 | 75 | protected function checkActions($action) |
73 | 76 | { |
74 | 77 | foreach ($this->actions as $names => $permissions) { |
@@ -110,8 +113,8 @@ discard block |
||
110 | 113 | * Denies the access of the user. |
111 | 114 | * The default implementation will redirect the user to the login page if he is a guest; |
112 | 115 | * if the user is already logged, a 403 HTTP exception will be thrown. |
113 | - * @param User|false $user the current user or boolean `false` in case of detached User component |
|
114 | 116 | * @throws ForbiddenHttpException if the user is already logged in or in case of detached User component. |
117 | + * @param Action $action |
|
115 | 118 | */ |
116 | 119 | protected function denyAccess($action) |
117 | 120 | { |
@@ -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])) { |