@@ -277,7 +277,7 @@ |
||
277 | 277 | /** |
278 | 278 | * Get array of user status. |
279 | 279 | * |
280 | - * @return array |
|
280 | + * @return string[] |
|
281 | 281 | */ |
282 | 282 | public function getStatuses() |
283 | 283 | { |
@@ -251,7 +251,7 @@ |
||
251 | 251 | */ |
252 | 252 | public function generatePasswordResetToken() |
253 | 253 | { |
254 | - $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time(); |
|
254 | + $this->password_reset_token = Yii::$app->security->generateRandomString().'_'.time(); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @param integer|null $id Media ID |
26 | 26 | * @param string|null $slug Media slug |
27 | - * @return mixed |
|
27 | + * @return string |
|
28 | 28 | * @throws \yii\web\NotFoundHttpException |
29 | 29 | */ |
30 | 30 | public function actionView($id = null, $slug = null) |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * If the model is not found, a 404 HTTP exception will be thrown. |
73 | 73 | * |
74 | 74 | * @param integer $id Media ID |
75 | - * @return Media the loaded model |
|
75 | + * @return string the loaded model |
|
76 | 76 | * @throws NotFoundHttpException if the model cannot be found |
77 | 77 | */ |
78 | 78 | protected function findModel($id) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * If the model is not found, a 404 HTTP exception will be thrown. |
90 | 90 | * |
91 | 91 | * @param string $slug Media slug |
92 | - * @return Media the loaded model |
|
92 | + * @return string the loaded model |
|
93 | 93 | * @throws NotFoundHttpException if the model cannot be found |
94 | 94 | */ |
95 | 95 | protected function findModelBySlug($slug) |
@@ -54,10 +54,10 @@ |
||
54 | 54 | return $this->render('protected', ['media' => $model]); |
55 | 55 | } |
56 | 56 | |
57 | - if (is_file($this->view->theme->basePath . '/media/view-' |
|
58 | - . substr($model->mime_type, 0, strpos($model->mime_type, '/', 1)) . '.php') |
|
57 | + if (is_file($this->view->theme->basePath.'/media/view-' |
|
58 | + . substr($model->mime_type, 0, strpos($model->mime_type, '/', 1)).'.php') |
|
59 | 59 | ) { |
60 | - $render = 'view-' . substr($model->mime_type, 0, strpos($model->mime_type, '/', 1)); |
|
60 | + $render = 'view-'.substr($model->mime_type, 0, strpos($model->mime_type, '/', 1)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $this->render($render, [ |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param null $slug Post slug |
76 | 76 | * @param integer $id Post ID |
77 | 77 | * @throws \yii\web\NotFoundHttpException |
78 | - * @return mixed |
|
78 | + * @return string |
|
79 | 79 | */ |
80 | 80 | public function actionView($id = null, $slug = null) |
81 | 81 | { |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | * Finds the Post model based on its primary key value. |
163 | 163 | * If the model is not found, a 404 HTTP exception will be thrown. |
164 | 164 | * |
165 | - * @param $id |
|
165 | + * @param integer $id |
|
166 | 166 | * @throws \yii\web\NotFoundHttpException |
167 | - * @return PostType the loaded model |
|
167 | + * @return string the loaded model |
|
168 | 168 | */ |
169 | 169 | protected function findPostType($id) |
170 | 170 | { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param string $slug Post type slug |
185 | 185 | * @throws \yii\web\NotFoundHttpException |
186 | - * @return PostType the loaded model |
|
186 | + * @return string the loaded model |
|
187 | 187 | */ |
188 | 188 | protected function findPostTypeBySlug($slug) |
189 | 189 | { |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $posts = $query->all(); |
56 | 56 | |
57 | 57 | if ($posts) { |
58 | - if (is_file($this->view->theme->basePath . '/post/index-' . $postType->name . '.php')) { |
|
59 | - $render = 'index-' . $postType->name . '.php'; |
|
58 | + if (is_file($this->view->theme->basePath.'/post/index-'.$postType->name.'.php')) { |
|
59 | + $render = 'index-'.$postType->name.'.php'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->render($render, [ |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | return $this->render('protected', ['post' => $model]); |
104 | 104 | } |
105 | 105 | |
106 | - if (is_file($this->view->theme->basePath . '/post/view-' . $model->postType->name . '.php')) { |
|
107 | - $render = 'view-' . $model->postType->name . '.php'; |
|
106 | + if (is_file($this->view->theme->basePath.'/post/view-'.$model->postType->name.'.php')) { |
|
107 | + $render = 'view-'.$model->postType->name.'.php'; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return $this->render($render, [ |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param integer $id Term ID |
29 | 29 | * @param null $slug Term slug |
30 | 30 | * @throws \yii\web\NotFoundHttpException |
31 | - * @return mixed |
|
31 | + * @return string |
|
32 | 32 | */ |
33 | 33 | public function actionView($id = null, $slug = null) |
34 | 34 | { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * If the model is not found, a 404 HTTP exception will be thrown. |
72 | 72 | * |
73 | 73 | * @param integer $id Term ID |
74 | - * @return Term the loaded model |
|
74 | + * @return string the loaded model |
|
75 | 75 | * @throws NotFoundHttpException if the model cannot be found |
76 | 76 | */ |
77 | 77 | protected function findModel($id) |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param string $slug Term Slug |
93 | 93 | * @throws \yii\web\NotFoundHttpException |
94 | 94 | * @internal param string $postslug |
95 | - * @return Term the loaded model |
|
95 | + * @return string the loaded model |
|
96 | 96 | */ |
97 | 97 | protected function findModelBySlug($slug) |
98 | 98 | { |
@@ -55,8 +55,8 @@ |
||
55 | 55 | ->limit($pages->limit) |
56 | 56 | ->all(); |
57 | 57 | |
58 | - if (is_file($this->view->theme->basePath . '/term/view-' . $model->taxonomy->name . '.php')) { |
|
59 | - $render = 'view-' . $model->taxonomy->name; |
|
58 | + if (is_file($this->view->theme->basePath.'/term/view-'.$model->taxonomy->name.'.php')) { |
|
59 | + $render = 'view-'.$model->taxonomy->name; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->render($render, [ |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @param null $id User ID |
29 | 29 | * @param string|null $user Username |
30 | - * @return mixed |
|
30 | + * @return string |
|
31 | 31 | * @throws \yii\web\NotFoundHttpException |
32 | 32 | */ |
33 | 33 | public function actionView($id = null, $user = null) |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * If the model is not found, a 404 HTTP exception will be thrown. |
75 | 75 | * |
76 | 76 | * @param int $id User ID |
77 | - * @return User the loaded model |
|
77 | + * @return string the loaded model |
|
78 | 78 | * @throws NotFoundHttpException if the model cannot be found |
79 | 79 | */ |
80 | 80 | protected function findModel($id) |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * If the model is not found, a 404 HTTP exception will be thrown. |
92 | 92 | * |
93 | 93 | * @param string $username Username |
94 | - * @return User the loaded model |
|
94 | + * @return string the loaded model |
|
95 | 95 | * @throws NotFoundHttpException if the model cannot be found |
96 | 96 | */ |
97 | 97 | protected function findModelByUsername($username) |
@@ -55,8 +55,8 @@ |
||
55 | 55 | $posts = $query->all(); |
56 | 56 | |
57 | 57 | if ($posts) { |
58 | - if (is_file($this->view->theme->basePath . '/user/view-' . $model->username . '.php')) { |
|
59 | - $render = 'view-' . $model->username . '.php'; |
|
58 | + if (is_file($this->view->theme->basePath.'/user/view-'.$model->username.'.php')) { |
|
59 | + $render = 'view-'.$model->username.'.php'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->render($render, [ |
@@ -60,7 +60,7 @@ |
||
60 | 60 | [ |
61 | 61 | 'actions' => ['signup'], |
62 | 62 | 'allow' => true, |
63 | - 'matchCallback' => function () { |
|
63 | + 'matchCallback' => function() { |
|
64 | 64 | return Option::get('allow_signup') && Yii::$app->user->isGuest; |
65 | 65 | }, |
66 | 66 | ], |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ] |
43 | 43 | ) ?> |
44 | 44 | |
45 | - <?php else: ?> |
|
45 | + <?php else : ?> |
|
46 | 46 | <?= Html::dropDownList( |
47 | 47 | 'termIds', |
48 | 48 | ArrayHelper::getColumn( |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | </div> |
93 | 93 | </div> |
94 | - <?php else: ?> |
|
94 | + <?php else : ?> |
|
95 | 95 | <?= Yii::t( |
96 | 96 | 'writesdown', 'Choose the {taxonomyName} above', |
97 | 97 | ['taxonomyName' => $taxonomy->singular_name] |
@@ -59,7 +59,7 @@ |
||
59 | 59 | [ |
60 | 60 | ['author', 'email'], |
61 | 61 | 'required', |
62 | - 'when' => function () { |
|
62 | + 'when' => function() { |
|
63 | 63 | return Option::get('require_name_email') && Yii::$app->user->isGuest ? true : false; |
64 | 64 | }, |
65 | 65 | ], |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | if ($sameTerm) { |
318 | 318 | $query->innerJoinWith([ |
319 | - 'terms' => function ($query) { |
|
319 | + 'terms' => function($query) { |
|
320 | 320 | /* @var $query \yii\db\ActiveQuery */ |
321 | 321 | $query->from(['term' => Term::tableName()])->andWhere([ |
322 | 322 | 'IN', |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | public function getNextPostLink($title = '{title}', $sameType = true, $sameTerm = false, $options = []) |
341 | 341 | { |
342 | 342 | if ($nextPost = $this->getNextPost($sameType, $sameTerm)) { |
343 | - $title = preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($nextPost) { |
|
343 | + $title = preg_replace_callback('/\\{([\w\-\/]+)\\}/', function($matches) use ($nextPost) { |
|
344 | 344 | $attribute = $matches[1]; |
345 | 345 | |
346 | 346 | return $nextPost->{$attribute}; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | if ($sameTerm) { |
374 | 374 | $query->innerJoinWith([ |
375 | - 'terms' => function ($query) { |
|
375 | + 'terms' => function($query) { |
|
376 | 376 | /* @var $query \yii\db\ActiveQuery */ |
377 | 377 | $query->from(['term' => Term::tableName()])->andWhere([ |
378 | 378 | 'IN', |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | public function getPrevPostLink($title = '{title}', $sameType = true, $sameTerm = false, $options = []) |
397 | 397 | { |
398 | 398 | if ($prevPost = $this->getPrevPost($sameType, $sameTerm)) { |
399 | - $title = preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($prevPost) { |
|
399 | + $title = preg_replace_callback('/\\{([\w\-\/]+)\\}/', function($matches) use ($prevPost) { |
|
400 | 400 | $attribute = $matches[1]; |
401 | 401 | |
402 | 402 | return $prevPost->{$attribute}; |