Passed
Push — master ( 96b324...4e12fe )
by Andrey
05:35
created
traits/AdditionFieldsTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param array $paginationOptions
21 21
      * @return array
22 22
      */
23
-    protected function getMediaFiles(string $ownerName, int $ownerId, string $ownerAttribute, array $paginationOptions = [])
23
+    protected function getMediaFiles(string $ownerName, int $ownerId, string $ownerAttribute, array $paginationOptions = [ ])
24 24
     {
25 25
         $mediafilesQuery = OwnerMediafile::getMediaFilesQuery([
26 26
             'owner' => $ownerName,
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             'ownerAttribute' => $ownerAttribute,
29 29
         ]);
30 30
         $pagination = new Pagination(array_merge([
31
-                'defaultPageSize' => Yii::$app->params['defaultPageSize'],
31
+                'defaultPageSize' => Yii::$app->params[ 'defaultPageSize' ],
32 32
                 'totalCount' => $mediafilesQuery->count()
33 33
             ], $paginationOptions)
34 34
         );
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         ]);
53 53
 
54 54
         if (!empty($type)) {
55
-            $albumsQuery = $albumsQuery->where(['type' => $type]);
55
+            $albumsQuery = $albumsQuery->where([ 'type' => $type ]);
56 56
         }
57 57
 
58 58
         return $albumsQuery->all();
Please login to merge, or discard this patch.
controllers/ajax/OrderAjaxController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
     public function verbs()
73 73
     {
74 74
         return [
75
-            'put-to-basket' => ['POST'],
76
-            'set-count-in-basket' => ['POST'],
77
-            'remove-from-basket' => ['POST'],
78
-            'send-order' => ['POST'],
75
+            'put-to-basket' => [ 'POST' ],
76
+            'set-count-in-basket' => [ 'POST' ],
77
+            'remove-from-basket' => [ 'POST' ],
78
+            'send-order' => [ 'POST' ],
79 79
         ];
80 80
     }
81 81
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 return $this->getSuccessResponse('', [
120 120
                     'total_amount' => $this->basketManager->calculateTotalAmount($modelItems),
121 121
                     'total_count' => $this->basketManager->getTotalCount(),
122
-                    'item_price' => $modelItems[$id]->price
122
+                    'item_price' => $modelItems[ $id ]->price
123 123
                 ]);
124 124
             }
125 125
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $order = new Order();
164 164
             $order->setAttributes(Yii::$app->request->post(), false);
165 165
 
166
-            if ($order->handle(Yii::$app->params['adminEmail'])) {
166
+            if ($order->handle(Yii::$app->params[ 'adminEmail' ])) {
167 167
                 $this->basketManager->clearBasket();
168 168
                 return $this->getSuccessResponse(Yii::t('order', 'You have successfully sent your order message.').' '.Yii::t('order', 'The manager will contact you.'));
169 169
 
Please login to merge, or discard this patch.
controllers/PageController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
                 'rules' => [
28 28
                     [
29 29
                         'allow' => true,
30
-                        'actions' => ['view'],
31
-                        'roles' => ['?', '@'],
30
+                        'actions' => [ 'view' ],
31
+                        'roles' => [ '?', '@' ],
32 32
                     ],
33 33
                 ],
34 34
             ],
35 35
             'verbs' => [
36 36
                 'class' => VerbFilter::class,
37 37
                 'actions' => [
38
-                    'view' => ['get'],
38
+                    'view' => [ 'get' ],
39 39
                 ],
40 40
             ],
41 41
         ]);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $pagination = new Pagination([
73 73
             'totalCount' => $articlesQuery->count(),
74
-            'defaultPageSize' => Yii::$app->params['defaultPageSize']
74
+            'defaultPageSize' => Yii::$app->params[ 'defaultPageSize' ]
75 75
         ]);
76 76
 
77 77
         return $this->render('view', [
Please login to merge, or discard this patch.
controllers/admin/ProductController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             return $this->accessError();
51 51
         }
52 52
 
53
-        $this->additionFields['images'] = $this->getMediaFiles(Product::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
53
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Product::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
54 54
 
55 55
         return parent::actionView($id);
56 56
     }
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
             return $this->accessError();
65 65
         }
66 66
 
67
-        $this->additionFields['categories'] = Category::getMenu();
68
-        $this->additionFields['albums'] = $this->getAlbums();
67
+        $this->additionFields[ 'categories' ] = Category::getMenu();
68
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
69 69
 
70 70
         return parent::actionCreate();
71 71
     }
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             return $this->accessError();
82 82
         }
83 83
 
84
-        $this->additionFields['categories'] = Category::getMenu();
85
-        $this->additionFields['albums'] = $this->getAlbums();
86
-        $this->additionFields['images'] = $this->getMediaFiles(Product::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
84
+        $this->additionFields[ 'categories' ] = Category::getMenu();
85
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
86
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Product::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
87 87
 
88 88
         return parent::actionUpdate($id);
89 89
     }
Please login to merge, or discard this patch.
controllers/admin/PageController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             return $this->accessError();
51 51
         }
52 52
 
53
-        $this->additionFields['images'] = $this->getMediaFiles(Page::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
53
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Page::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
54 54
 
55 55
         return parent::actionView($id);
56 56
     }
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
             return $this->accessError();
65 65
         }
66 66
 
67
-        $this->additionFields['pages'] = Page::getMenu();
68
-        $this->additionFields['albums'] = $this->getAlbums();
67
+        $this->additionFields[ 'pages' ] = Page::getMenu();
68
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
69 69
 
70 70
         return parent::actionCreate();
71 71
     }
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             return $this->accessError();
82 82
         }
83 83
 
84
-        $this->additionFields['pages'] = Page::getMenu();
85
-        $this->additionFields['albums'] = $this->getAlbums();
86
-        $this->additionFields['images'] = $this->getMediaFiles(Page::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
84
+        $this->additionFields[ 'pages' ] = Page::getMenu();
85
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
86
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Page::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
87 87
 
88 88
         return parent::actionUpdate($id);
89 89
     }
Please login to merge, or discard this patch.
controllers/admin/ArticleController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             return $this->accessError();
51 51
         }
52 52
 
53
-        $this->additionFields['images'] = $this->getMediaFiles(Article::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
53
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Article::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
54 54
 
55 55
         return parent::actionView($id);
56 56
     }
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
             return $this->accessError();
65 65
         }
66 66
 
67
-        $this->additionFields['pages'] = Page::getMenu();
68
-        $this->additionFields['albums'] = $this->getAlbums();
67
+        $this->additionFields[ 'pages' ] = Page::getMenu();
68
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
69 69
 
70 70
         return parent::actionCreate();
71 71
     }
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             return $this->accessError();
82 82
         }
83 83
 
84
-        $this->additionFields['pages'] = Page::getMenu();
85
-        $this->additionFields['albums'] = $this->getAlbums();
86
-        $this->additionFields['images'] = $this->getMediaFiles(Article::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
84
+        $this->additionFields[ 'pages' ] = Page::getMenu();
85
+        $this->additionFields[ 'albums' ] = $this->getAlbums();
86
+        $this->additionFields[ 'images' ] = $this->getMediaFiles(Article::tableName(), (int)$id, UploadModelInterface::FILE_TYPE_IMAGE);
87 87
 
88 88
         return parent::actionUpdate($id);
89 89
     }
Please login to merge, or discard this patch.
controllers/admin/CategoryController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             return $this->accessError();
62 62
         }
63 63
 
64
-        $this->additionFields['categories'] = Category::getMenu();
64
+        $this->additionFields[ 'categories' ] = Category::getMenu();
65 65
 
66 66
         return parent::actionCreate();
67 67
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             return $this->accessError();
78 78
         }
79 79
 
80
-        $this->additionFields['categories'] = Category::getMenu();
80
+        $this->additionFields[ 'categories' ] = Category::getMenu();
81 81
 
82 82
         return parent::actionUpdate($id);
83 83
     }
Please login to merge, or discard this patch.
controllers/BaseController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function beforeAction($action)
33 33
     {
34
-        $this->view->params['pages'] = Page::getActiveMenu();
35
-        $this->view->params['categories'] = Category::getActiveMenu();
36
-        $this->view->params['contacts'] = Contact::getDefaultContacts();
37
-        $this->view->params['controllerId'] = Yii::$app->controller->id;
34
+        $this->view->params[ 'pages' ] = Page::getActiveMenu();
35
+        $this->view->params[ 'categories' ] = Category::getActiveMenu();
36
+        $this->view->params[ 'contacts' ] = Contact::getDefaultContacts();
37
+        $this->view->params[ 'controllerId' ] = Yii::$app->controller->id;
38 38
 
39 39
         return parent::beforeAction($action);
40 40
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $this->view->registerLinkTag([
76 76
                 'rel' => 'alternate',
77 77
                 'hreflang' => $shortName,
78
-                'href' => rtrim(Yii::$app->request->hostInfo, '/') .
78
+                'href' => rtrim(Yii::$app->request->hostInfo, '/').
79 79
                     BaseHelper::getSwitchLanguageLink($shortName, Yii::$app->request)
80 80
             ]);
81 81
         }
Please login to merge, or discard this patch.
controllers/ArticleController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@
 block discarded – undo
25 25
                 'rules' => [
26 26
                     [
27 27
                         'allow' => true,
28
-                        'actions' => ['view'],
29
-                        'roles' => ['?', '@'],
28
+                        'actions' => [ 'view' ],
29
+                        'roles' => [ '?', '@' ],
30 30
                     ],
31 31
                 ],
32 32
             ],
33 33
             'verbs' => [
34 34
                 'class' => VerbFilter::class,
35 35
                 'actions' => [
36
-                    'view' => ['get'],
36
+                    'view' => [ 'get' ],
37 37
                 ],
38 38
             ],
39 39
         ]);
Please login to merge, or discard this patch.