Test Failed
Push — master ( 101480...045277 )
by Alexey
04:28
created
system/modules/Ecommerce/appControllers/EcommerceController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public function submitReviewAction() {
14 14
         $result = new \Server\Result();
15 15
         if (!empty($_POST['review']['item_id']) && !empty($_POST['review']['name']) && !empty($_POST['review']['text'])) {
16
-            $item = Ecommerce\Item::get((int)$_POST['review']['item_id']);
16
+            $item = Ecommerce\Item::get((int) $_POST['review']['item_id']);
17 17
             if (!$item) {
18 18
                 $result->success = false;
19 19
                 $result->content = ['errorText' => 'Товар не найден'];
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
                 'item_id' => $item->id,
24 24
                 'user_id' => \Users\User::$cur->id,
25 25
                 'name' => htmlspecialchars($_POST['review']['name']),
26
-                'rating' => (int)$_POST['review']['rating'],
26
+                'rating' => (int) $_POST['review']['rating'],
27 27
                 'text' => htmlspecialchars($_POST['review']['text']),
28 28
                 'mail' => !empty($_POST['review']['email']) ? htmlspecialchars($_POST['review']['email']) : '',
29 29
                 'file_id' => !empty($_FILES['review']['tmp_name']['file']) ? App::$cur->files->upload([
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $user = Users\User::$cur;
48 48
         if (!empty($_POST) && !empty($_POST['card_id'])) {
49 49
             $error = false;
50
-            $card = \Ecommerce\Card::get((int)$_POST['card_id']);
50
+            $card = \Ecommerce\Card::get((int) $_POST['card_id']);
51 51
             if (!$card) {
52 52
                 $error = true;
53 53
                 Msg::add('Такой карты не существует', 'danger');
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         //search
134 134
         if (!empty($_GET['search'])) {
135 135
             if (!empty($_GET['inCatalog'])) {
136
-                $category_id = (int)$_GET['inCatalog'];
136
+                $category_id = (int) $_GET['inCatalog'];
137 137
             }
138 138
             $search = $_GET['search'];
139 139
         } else {
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
         if ($category_id) {
159 159
 
160 160
             if (is_numeric($category_id)) {
161
-                $category = $categoryClass::get((int)$category_id);
161
+                $category = $categoryClass::get((int) $category_id);
162 162
             }
163 163
             if (!$category) {
164
-                $category = $categoryClass::get((int)$category_id, 'alias');
164
+                $category = $categoryClass::get((int) $category_id, 'alias');
165 165
             }
166 166
             if ($category) {
167 167
                 $category_id = $category->id;
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
                 $opts = array_merge($opts, array_keys($cat->options(['key' => 'item_option_id'])));
237 237
             }
238 238
             $opts = array_unique($opts);
239
-            if($opts) {
239
+            if ($opts) {
240 240
                 $options = \Ecommerce\Item\Option::getList(['where' => [['item_option_searchable', 1], ['id', $opts, 'IN']], 'order' => ['weight', 'asc']]);
241 241
             }
242 242
             else {
243
-                $options=[];
243
+                $options = [];
244 244
             }
245 245
         } elseif (empty(App::$cur->ecommerce->config['filtersInLast'])) {
246 246
             $options = \Ecommerce\Item\Option::getList(['where' => ['item_option_searchable', 1], 'order' => ['weight', 'asc']]);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     }
304 304
 
305 305
     public function viewAction($id = '', $quick = 0) {
306
-        $item = \Ecommerce\Item::get((int)$id);
306
+        $item = \Ecommerce\Item::get((int) $id);
307 307
         if (!$item) {
308 308
             Tools::redirect('/ecommerce/', 'Такой товар не найден');
309 309
         }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
     public function toggleFavAction($itemId) {
353 353
         $result = new Server\Result();
354
-        $item = \Ecommerce\Item::get((int)$itemId);
354
+        $item = \Ecommerce\Item::get((int) $itemId);
355 355
         if (!$item) {
356 356
             $result->success = false;
357 357
             $result->content = 'Товар не найден';
Please login to merge, or discard this patch.
system/modules/UserForms/UserForms.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
         \App::$cur->view->customAsset('js', '/static/moduleAsset/UserForms/js/formCatcher.js');
15 15
         if (!empty($_POST['UserForms'])) {
16 16
             foreach ($_POST['UserForms'] as $form_id => $inputs) {
17
-                $form = \UserForms\Form::get((int)$form_id);
17
+                $form = \UserForms\Form::get((int) $form_id);
18 18
                 if (!$form) {
19 19
                     continue;
20 20
                 }
21 21
                 $formRecive = new \UserForms\Recive();
22
-                $formRecive->user_id = (int)\Users\User::$cur->id;
23
-                $formRecive->form_id = (int)$form_id;
22
+                $formRecive->user_id = (int) \Users\User::$cur->id;
23
+                $formRecive->form_id = (int) $form_id;
24 24
                 $data = [];
25 25
                 $error = false;
26 26
                 foreach ($form->inputs as $input) {
Please login to merge, or discard this patch.
system/modules/Ecommerce/objects/DeliveryProvider/RussianPost.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,6 +49,6 @@
 block discarded – undo
49 49
         ];
50 50
         $result = json_decode(file_get_contents($url . http_build_query($data)), true);
51 51
         $sum = !empty($result['tariff'][0]['ground']['valnds']) ? $result['tariff'][0]['ground']['valnds'] : (!empty($result['tariff'][0]['avia']['valnds']) ? $result['tariff'][0]['avia']['valnds'] : 0);
52
-        return new \Money\Sums([$cart->delivery->currency_id => $sum/100]);
52
+        return new \Money\Sums([$cart->delivery->currency_id => $sum / 100]);
53 53
     }
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/Ui/objects/DataManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         ob_end_clean();
197 197
 
198 198
         $cols = [];
199
-        if($actions) {
199
+        if ($actions) {
200 200
             $cols[] = ['label' => $dropdown];
201 201
         }
202 202
         $cols['id'] = ['label' => '№', 'sortable' => true];
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
         $queryParams = [];
245 245
         if (empty($params['all'])) {
246 246
             if (!empty($params['limit'])) {
247
-                $this->limit = (int)$params['limit'];
247
+                $this->limit = (int) $params['limit'];
248 248
             }
249 249
             if (!empty($params['page'])) {
250
-                $this->page = (int)$params['page'];
250
+                $this->page = (int) $params['page'];
251 251
             }
252 252
             $queryParams['limit'] = $this->limit;
253 253
             $queryParams['start'] = $this->page * $this->limit - $this->limit;
@@ -557,10 +557,10 @@  discard block
 block discarded – undo
557 557
             return [];
558 558
         }
559 559
         if (!empty($params['limit'])) {
560
-            $this->limit = (int)$params['limit'];
560
+            $this->limit = (int) $params['limit'];
561 561
         }
562 562
         if (!empty($params['page'])) {
563
-            $this->page = (int)$params['page'];
563
+            $this->page = (int) $params['page'];
564 564
         }
565 565
         $queryParams = [
566 566
             'count' => true
Please login to merge, or discard this patch.
system/modules/Users/appControllers/UsersController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
     }
113 113
 
114 114
     public function activationAction($userId = 0, $hash = '') {
115
-        $user = \Users\User::get((int)$userId);
116
-        if (!$user || !$hash || $user->activation !== (string)$hash) {
115
+        $user = \Users\User::get((int) $userId);
116
+        if (!$user || !$hash || $user->activation !== (string) $hash) {
117 117
             Tools::redirect('/', 'Во время активации произошли ошибки', 'danger');
118 118
         }
119 119
         $user->activation = '';
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     }
157 157
 
158 158
     public function resendActivationAction($userId = 0) {
159
-        $user = \Users\User::get((int)$userId);
159
+        $user = \Users\User::get((int) $userId);
160 160
         if (!$user) {
161 161
             Tools::redirect('/', 'Не указан пользователь', 'danger');
162 162
         }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     }
173 173
 
174 174
     public function getPartnerInfoAction($userId = 0) {
175
-        $userId = (int)$userId;
175
+        $userId = (int) $userId;
176 176
         $result = new \Server\Result();
177 177
         if (!$userId) {
178 178
             $result->success = false;
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
     public function changeWarehouse($count) {
103 103
         $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]);
104 104
         if ($warehouse) {
105
-            $warehouse->count += (float)$count;
105
+            $warehouse->count += (float) $count;
106 106
             $warehouse->save();
107 107
         } else {
108 108
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
109 109
             if ($warehouse) {
110
-                $warehouse->count += (float)$count;
110
+                $warehouse->count += (float) $count;
111 111
                 $warehouse->save();
112 112
             }
113 113
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` ';
135 135
         \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
136 136
         if ($cart_id) {
137
-            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int)$cart_id, '!=');
137
+            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!=');
138 138
         }
139 139
         $on = '
140 140
             ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND (
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 
148 148
         $blocked = \App::$cur->db->select(\Ecommerce\Warehouse\Block::table())->fetch();
149
-        return (float)$warehouse['sum'] - (float)$blocked['sum'];
149
+        return (float) $warehouse['sum'] - (float) $blocked['sum'];
150 150
     }
151 151
 
152 152
     public function beforeDelete() {
Please login to merge, or discard this patch.