Completed
Push — master ( fb7a26...d5e2d7 )
by Agiel Kurniawan
04:29
created
backend/controllers/MediaCommentController.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * If there is media, the action will generate list of all MediaComment models based on Media ID.
56 56
      *
57 57
      * @param null|integer $media Media ID
58
-     * @return mixed
58
+     * @return string
59 59
      */
60 60
     public function actionIndex($media = null)
61 61
     {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      * If deletion is successful, the browser will be redirected to the 'index' page.
105 105
      *
106 106
      * @param integer $id
107
-     * @return mixed
107
+     * @return \yii\web\Response
108 108
      */
109 109
     public function actionDelete($id)
110 110
     {
Please login to merge, or discard this patch.
backend/controllers/MenuController.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * Displays menu page consists of CRUD for Menu and MenuItem model.
62 62
      *
63 63
      * @param null $id
64
-     * @return mixed
64
+     * @return string
65 65
      */
66 66
     public function actionIndex($id = null)
67 67
     {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * Creates a new Menu model.
91 91
      * If creation is successful, the browser will be redirected to the 'index' page.
92 92
      *
93
-     * @return mixed
93
+     * @return \yii\web\Response
94 94
      */
95 95
     public function actionCreate()
96 96
     {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * If update is successful, the browser will be redirected to the 'view' page.
109 109
      *
110 110
      * @param integer $id
111
-     * @return mixed
111
+     * @return \yii\web\Response
112 112
      */
113 113
     public function actionUpdate($id)
114 114
     {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      * Deletes an existing Menu model.
130 130
      * If deletion is successful, the browser will be redirected to the 'index' page.
131 131
      *
132
-     * @return mixed
132
+     * @return \yii\web\Response
133 133
      * @throws NotFoundHttpException
134 134
      * @throws \Exception
135 135
      */
Please login to merge, or discard this patch.
backend/controllers/PostCommentController.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
      * If deletion is successful, the browser will be redirected to the 'index' page.
112 112
      *
113 113
      * @param integer $id
114
-     * @return mixed
114
+     * @return \yii\web\Response
115 115
      */
116 116
     public function actionDelete($id)
117 117
     {
Please login to merge, or discard this patch.
backend/controllers/PostController.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param null|string $user
65 65
      * @throws \yii\web\ForbiddenHttpException
66 66
      * @throws \yii\web\NotFoundHttpException
67
-     * @return mixed
67
+     * @return string
68 68
      */
69 69
     public function actionIndex($type, $user = null)
70 70
     {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @throws \Exception
180 180
      * @throws \yii\web\ForbiddenHttpException
181 181
      * @throws \yii\web\NotFoundHttpException
182
-     * @return mixed
182
+     * @return Response
183 183
      */
184 184
     public function actionDelete($id)
185 185
     {
Please login to merge, or discard this patch.
backend/controllers/SettingController.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     /**
58 58
      * Lists all Option models.
59 59
      *
60
-     * @return mixed
60
+     * @return string
61 61
      */
62 62
     public function actionIndex()
63 63
     {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * Displays single Option model.
75 75
      *
76 76
      * @param integer $id
77
-     * @return mixed
77
+     * @return string
78 78
      */
79 79
     public function actionView($id)
80 80
     {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * If deletion is successful, the browser will be redirected to the 'index' page.
128 128
      *
129 129
      * @param integer $id
130
-     * @return mixed
130
+     * @return \yii\web\Response
131 131
      */
132 132
     public function actionDelete($id)
133 133
     {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * If the models are not found, a 404 HTTP exception will be thrown.
190 190
      *
191 191
      * @param string $id
192
-     * @return Option the loaded model
192
+     * @return string the loaded model
193 193
      * @throws NotFoundHttpException if the models cannot be found
194 194
      */
195 195
     protected function findModelByGroup($id)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
             return $this->redirect(['group', 'id' => $id]);
158 158
         }
159 159
 
160
-        if (is_file($this->getViewPath() . '/' . strtolower($id) . '.php')) {
160
+        if (is_file($this->getViewPath().'/'.strtolower($id).'.php')) {
161 161
             return $this->render(strtolower($id), [
162 162
                 'model' => (object)$model,
163 163
                 'group' => $id,
Please login to merge, or discard this patch.
backend/controllers/TaxonomyController.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     /**
64 64
      * Lists all Taxonomy models.
65 65
      *
66
-     * @return mixed
66
+     * @return string
67 67
      */
68 68
     public function actionIndex()
69 69
     {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * If deletion is successful, the browser will be redirected to the 'index' page.
149 149
      *
150 150
      * @param integer $id
151
-     * @return mixed
151
+     * @return \yii\web\Response
152 152
      */
153 153
     public function actionDelete($id)
154 154
     {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      * @param integer $term
212 212
      * @throws \Exception
213 213
      * @throws \yii\web\NotFoundHttpException
214
-     * @return mixed
214
+     * @return \yii\web\Response
215 215
      */
216 216
     public function actionDeleteTerm($id, $term)
217 217
     {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      * If the model is not found, a 404 HTTP exception will be thrown.
258 258
      *
259 259
      * @param integer $id
260
-     * @return Term the loaded model
260
+     * @return integer the loaded model
261 261
      * @throws NotFoundHttpException if the model cannot be found
262 262
      */
263 263
     protected function findTerm($id)
Please login to merge, or discard this patch.
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -173,7 +173,6 @@  discard block
 block discarded – undo
173 173
 
174 174
     /**
175 175
      * Updates an existing Term on 'view taxonomy' page.
176
-
177 176
      *
178 177
 *@param $id
179 178
      * @param $term
@@ -205,7 +204,6 @@  discard block
 block discarded – undo
205 204
     /**
206 205
      * Delete an existing Term of a taxonomy on 'view taxonomy' page.
207 206
      * If deletion is successful, the browser will be redirected to the 'view taxonomy' page.
208
-
209 207
      *
210 208
 *@param integer $id
211 209
      * @param integer $term
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@
 block discarded – undo
229 229
 
230 230
         if ($model->load(Yii::$app->request->post()) && $model->save()) {
231 231
             return '<br />'
232
-            . Html::label(Html::checkbox('taxonomy_ids[]', true, ['value' => $model->id]) . ' ' . $model->name);
232
+            . Html::label(Html::checkbox('taxonomy_ids[]', true, ['value' => $model->id]).' '.$model->name);
233 233
         }
234 234
 
235 235
         return '';
Please login to merge, or discard this patch.
backend/controllers/UserController.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     /**
59 59
      * Lists all User models.
60 60
      *
61
-     * @return mixed
61
+     * @return string
62 62
      */
63 63
     public function actionIndex()
64 64
     {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * Displays a single User model.
76 76
      *
77 77
      * @param integer $id
78
-     * @return mixed
78
+     * @return string
79 79
      */
80 80
     public function actionView($id)
81 81
     {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      * @throws \Exception
145 145
      * @throws \yii\web\ForbiddenHttpException
146 146
      * @throws \yii\web\NotFoundHttpException
147
-     * @return mixed
147
+     * @return \yii\web\Response
148 148
      */
149 149
     public function actionDelete($id)
150 150
     {
Please login to merge, or discard this patch.
backend/controllers/WidgetController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     /**
76 76
      * Scan widget directory to get list of all available widgets and list all active widgets.
77 77
      *
78
-     * @return mixed
78
+     * @return string
79 79
      */
80 80
     public function actionIndex()
81 81
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
         }
90 90
 
91 91
         foreach (scandir($this->_dir) as $widget) {
92
-            if (is_dir($this->_dir . $widget) && $widget !== '.' && $widget !== '..') {
93
-                $configPath = $this->_dir . $widget . '/config/main.php';
92
+            if (is_dir($this->_dir.$widget) && $widget !== '.' && $widget !== '..') {
93
+                $configPath = $this->_dir.$widget.'/config/main.php';
94 94
                 if (is_file($configPath)) {
95 95
                     $config = require($configPath);
96 96
                     $config['directory'] = $widget;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         if (($model->file = UploadedFile::getInstance($model, 'file')) && $model->validate(['file'])) {
140
-            $tmpPath = $this->_tmp . $model->file->name;
140
+            $tmpPath = $this->_tmp.$model->file->name;
141 141
 
142 142
             if (!$model->file->saveAs($tmpPath)) {
143 143
                 return $this->render('create', [
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
             $baseDir = substr($zipArchive->getNameIndex(0), 0, strpos($zipArchive->getNameIndex(0), '/'));
163 163
             $zipArchive->close();
164
-            $configPath = $this->_tmp . $baseDir . '/config/main.php';
164
+            $configPath = $this->_tmp.$baseDir.'/config/main.php';
165 165
 
166 166
             if (!is_file($configPath)) {
167 167
                 FileHelper::removeDirectory($this->_tmp);
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 
175 175
             $config = require($configPath);
176 176
 
177
-            if (is_dir($this->_dir . $baseDir)) {
177
+            if (is_dir($this->_dir.$baseDir)) {
178 178
                 $errors['dirExist'] = Yii::t('writesdown', 'Widget with the same directory already exist.');
179 179
             } else {
180
-                rename($this->_tmp . $baseDir, $this->_dir . $baseDir);
180
+                rename($this->_tmp.$baseDir, $this->_dir.$baseDir);
181 181
             }
182 182
 
183 183
             FileHelper::removeDirectory($this->_tmp);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 return $this->redirect(['index']);
195 195
             } else {
196 196
                 if (!$errors['dirExist']) {
197
-                    FileHelper::removeDirectory($this->_dir . $baseDir);
197
+                    FileHelper::removeDirectory($this->_dir.$baseDir);
198 198
                 }
199 199
 
200 200
                 $errors = ArrayHelper::merge($errors, $model->getFirstErrors());
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function actionDelete($id)
218 218
     {
219
-        FileHelper::removeDirectory($this->_dir . $id);
219
+        FileHelper::removeDirectory($this->_dir.$id);
220 220
         Widget::deleteAll(['directory' => $id]);
221 221
 
222 222
         return $this->redirect(['index']);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     {
234 234
         $model = new Widget(['scenario' => 'activate']);
235 235
         if ($model->load(Yii::$app->request->post())) {
236
-            $configPath = $this->_dir . $id . '/config/main.php';
236
+            $configPath = $this->_dir.$id.'/config/main.php';
237 237
             $config = require($configPath);
238 238
 
239 239
             // Set attribute of model
Please login to merge, or discard this patch.
common/components/MediaUploadHandler.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
     /**
142 142
      * Get server var based on id. Return null when it's not exist.
143 143
      *
144
-     * @param $id
145
-     * @return mixed
144
+     * @param string $id
145
+     * @return string
146 146
      */
147 147
     protected function getServerVar($id)
148 148
     {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      * If the model is not found it will return null.
209 209
      *
210 210
      * @param integer $id
211
-     * @return Media|array
211
+     * @return Media
212 212
      */
213 213
     protected function findMedia($id)
214 214
     {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
      * The number before fileName extension is replaced by upCountNameCallback.
332 332
      *
333 333
      * @param string $fileName
334
-     * @return mixed
334
+     * @return string
335 335
      * @see upCountNameCallback
336 336
      */
337 337
     protected function upCountName($fileName)
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     }
411 411
 
412 412
     /**
413
-     * @param $fileName
413
+     * @param string $fileName
414 414
      * @param $version
415 415
      * @param $options
416 416
      * @return bool|\imagine\Image\ManipulatorInterface
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
     }
571 571
 
572 572
     /**
573
-     * @param $pages Pagination
573
+     * @param Pagination $pages Pagination
574 574
      * @return array
575 575
      */
576 576
     protected function getPaging($pages)
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     protected function getUserPath()
244 244
     {
245 245
         if ($this->options['user_dirs'] && !Yii::$app->user->isGuest) {
246
-            return Yii::$app->user->identity->username . '/';
246
+            return Yii::$app->user->identity->username.'/';
247 247
         }
248 248
 
249 249
         return '';
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     protected function getUploadPath($fileName = null)
273 273
     {
274
-        return $this->getOption('upload_dir') . $this->getUserPath() . $this->getYearMonthPath() . $fileName;
274
+        return $this->getOption('upload_dir').$this->getUserPath().$this->getYearMonthPath().$fileName;
275 275
     }
276 276
 
277 277
     /**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      */
283 283
     protected function getFilePath($fileName = null)
284 284
     {
285
-        return $this->getOption('upload_dir') . $fileName;
285
+        return $this->getOption('upload_dir').$fileName;
286 286
     }
287 287
 
288 288
     /**
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
325 325
         $ext = isset($matches[2]) ? $matches[2] : '';
326 326
 
327
-        return '-' . $index . $ext;
327
+        return '-'.$index.$ext;
328 328
     }
329 329
 
330 330
     /**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
     {
352 352
         $index = 0;
353 353
         $fileName = $this->generateSlug($file->baseName);
354
-        $fileName .= '.' . $file->extension;
354
+        $fileName .= '.'.$file->extension;
355 355
         $fileName = trim(basename(stripslashes($fileName)), ".\x00..\x20");
356 356
 
357 357
         if (!$fileName) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
         if ($index !== 0) {
367 367
             // Replace media title
368
-            $this->_media->title = $file->baseName . ' ' . $index;
368
+            $this->_media->title = $file->baseName.' '.$index;
369 369
         }
370 370
 
371 371
         return $fileName;
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
             if (empty($options['crop'])) {
443 443
                 $newWidth = round($imageWidth * $scale);
444 444
                 $newHeight = round($imageHeight * $scale);
445
-                $newFileName = substr($fileName, 0, -(strlen($this->_media->file->extension) + 1)) .
446
-                    '-' . $newWidth .
447
-                    'x' . $newHeight .
448
-                    '.' . $this->_media->file->extension;
445
+                $newFileName = substr($fileName, 0, -(strlen($this->_media->file->extension) + 1)).
446
+                    '-'.$newWidth.
447
+                    'x'.$newHeight.
448
+                    '.'.$this->_media->file->extension;
449 449
                 $newFilePath = $this->getFilePath($newFileName);
450 450
                 $success = $image->thumbnail(new Box($newWidth, $newHeight))
451 451
                     ->save($newFilePath);
@@ -466,10 +466,10 @@  discard block
 block discarded – undo
466 466
                 }
467 467
                 $pointX = abs(round(($newWidth - $maxWidth) / 2));
468 468
                 $pointY = abs(round(($newHeight - $maxHeight) / 2));
469
-                $newFileName = substr($fileName, 0, -(strlen($this->_media->file->extension) + 1)) .
470
-                    '-' . $maxWidth .
471
-                    'x' . $maxHeight .
472
-                    '.' . $this->_media->file->extension;
469
+                $newFileName = substr($fileName, 0, -(strlen($this->_media->file->extension) + 1)).
470
+                    '-'.$maxWidth.
471
+                    'x'.$maxHeight.
472
+                    '.'.$this->_media->file->extension;
473 473
                 $newFilePath = $this->getFilePath($newFileName);
474 474
                 $success = $image->thumbnail(new Box($newWidth, $newHeight), ManipulatorInterface::THUMBNAIL_OUTBOUND)
475 475
                     ->crop(new Point($pointX, $pointY), new Box($maxWidth, $maxHeight))
@@ -698,9 +698,9 @@  discard block
 block discarded – undo
698 698
 
699 699
         if (preg_match('/^image\//', $media->mime_type)) {
700 700
             $response['type'] = 'image';
701
-            $response['icon_url'] = $this->getOption('upload_url') . $metadata['icon_url'];
701
+            $response['icon_url'] = $this->getOption('upload_url').$metadata['icon_url'];
702 702
         } else {
703
-            $response['icon_url'] = Yii::getAlias('@web') . '/' . $metadata['icon_url'];
703
+            $response['icon_url'] = Yii::getAlias('@web').'/'.$metadata['icon_url'];
704 704
             if (preg_match('/^video\//', $media->mime_type)) {
705 705
                 $response['type'] = 'video';
706 706
             } elseif (preg_match('/^audio\//', $media->mime_type)) {
Please login to merge, or discard this patch.