Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Money/widgets/cabinet/walletsWidget.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 <?php
3 3
 $blocked = App::$cur->money->getUserBlocks();
4 4
 $wallets = App::$cur->money->getUserWallets();
5
-foreach ($wallets as $wallet) {
5
+foreach ($wallets as $wallet) {
6 6
     ?>
7 7
     <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br />
8 8
     <?php
Please login to merge, or discard this patch.
system/modules/Money/widgets/cabinet/walletBlocked.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -2,17 +2,18 @@  discard block
 block discarded – undo
2 2
 <?php
3 3
 $currency_id = !empty($_GET['currency_id']) ? (int) $_GET['currency_id'] : 0;
4 4
 $wallets = App::$cur->money->getUserWallets();
5
-if ($currency_id && empty($wallets[$currency_id])) {
5
+if ($currency_id && empty($wallets[$currency_id])) {
6 6
     Msg::add('У вас нет такого кошелька');
7 7
     Msg::show();
8 8
     return;
9 9
 }
10 10
 
11
-if ($currency_id) {
11
+if ($currency_id) {
12 12
     $ids = $wallets[$currency_id]->id;
13
-} else {
13
+}
14
+else {
14 15
     $ids = [];
15
-    foreach ($wallets as $wallet) {
16
+    foreach ($wallets as $wallet) {
16 17
         $ids[] = $wallet->id;
17 18
     }
18 19
     $ids = implode(',', $ids);
@@ -33,7 +34,7 @@  discard block
 block discarded – undo
33 34
             'start' => $pages->params['start'],
34 35
             'limit' => $pages->params['limit'],
35 36
         ]);
36
-foreach ($histories as $history) {
37
+foreach ($histories as $history) {
37 38
     $amount = $history->amount;
38 39
     $table->addRow([
39 40
         $history->id,
Please login to merge, or discard this patch.
system/modules/Money/models/Reward.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@
 block discarded – undo
81 81
                 }
82 82
                 if ($complete) {
83 83
                     $usersCompleted[$block->wallet->user_id] = true;
84
-                } else {
84
+                }
85
+                else {
85 86
                     $usersCompleted[$block->wallet->user_id] = false;
86 87
                 }
87 88
             }
Please login to merge, or discard this patch.
system/modules/Money/models/Merchant.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,8 @@
 block discarded – undo
87 87
         foreach ($this->currencies as $merchantCurrency) {
88 88
             if ($merchantCurrency->currency_id == $pay->currency_id) {
89 89
                 $allowCurrencies[] = ['type' => 'primary', 'currency' => $merchantCurrency->currency];
90
-            } else {
90
+            }
91
+            else {
91 92
                 $transfer = Currency\ExchangeRate::get([['currency_id', $merchantCurrency->currency_id], ['target_currency_id', $pay->currency_id]]);
92 93
                 if ($transfer) {
93 94
                     $allowCurrencies[] = ['type' => 'transfer', 'currency' => $merchantCurrency->currency, 'transfer' => $transfer];
Please login to merge, or discard this patch.
system/modules/Money/appControllers/MoneyController.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -51,7 +51,8 @@  discard block
 block discarded – undo
51 51
         if (!empty($_POST['code'])) {
52 52
             if ($transfer->code != $_POST['code']) {
53 53
                 Msg::add('Код не совпадает', 'danger');
54
-            } else {
54
+            }
55
+            else {
55 56
                 $transfer->complete = 1;
56 57
                 $block = Money\Wallet\Block::get('Money\Transfer:' . $transfer->id, 'data');
57 58
                 $block->delete();
@@ -94,7 +95,8 @@  discard block
 block discarded – undo
94 95
             ]);
95 96
             $pay->save();
96 97
             Tools::redirect('/money/merchants/pay/' . $pay->id);
97
-        } else {
98
+        }
99
+        else {
98 100
             $currencies = Money\Currency::getList(['where' => ['refill', 1], 'forSelect' => true]);
99 101
             $this->view->setTitle('Пополнение счета');
100 102
             $this->view->page(['data' => compact('currencies')]);
@@ -114,17 +116,20 @@  discard block
 block discarded – undo
114 116
         $where = [];
115 117
         if ($currency) {
116 118
             $where[] = ['currency_id', $currency->id];
117
-        } else {
119
+        }
120
+        else {
118 121
             $where[] = ['currency_id', implode(',', array_keys($wallets)), 'IN'];
119 122
         }
120 123
         if ($targetCurrency) {
121 124
             $where[] = ['target_currency_id', $targetCurrency->id];
122
-        } else {
125
+        }
126
+        else {
123 127
             $where[] = ['target_currency_id', implode(',', array_keys($wallets)), 'IN'];
124 128
         }
125 129
         if ($where) {
126 130
             $rates = Money\Currency\ExchangeRate::getList(['where' => $where]);
127
-        } else {
131
+        }
132
+        else {
128 133
             $rates = [];
129 134
         }
130 135
         if (!empty($_GET['exchange']) && $currency && $targetCurrency && !empty($rates[$_GET['exchange']['rate_id']])) {
@@ -133,7 +138,8 @@  discard block
 block discarded – undo
133 138
             if (empty($_GET['exchange']['give']['amount']) || !(float) $_GET['exchange']['give']['amount']) {
134 139
                 Msg::add('Укажите сумму которую вы хотите отдать');
135 140
                 $error = true;
136
-            } else {
141
+            }
142
+            else {
137 143
                 $amount = (float) $_GET['exchange']['give']['amount'];
138 144
             }
139 145
             if (!empty($amount) && $amount > $wallets[$currency->id]->amount) {
@@ -165,7 +171,8 @@  discard block
 block discarded – undo
165 171
                 Tools::redirect('/money/merchants/pay/' . $pay->id, 'Нет возможности оплатить счет в валюте ' . $pay->currency->name() . ' валютой ' . $wallet->currency->name());
166 172
             }
167 173
             $sum = $pay->sum / $rate->rate;
168
-        } else {
174
+        }
175
+        else {
169 176
             $sum = $pay->sum;
170 177
         }
171 178
         if ($sum > $wallet->amount) {
Please login to merge, or discard this patch.
system/modules/Money/appControllers/MerchantsController.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,14 +30,16 @@  discard block
 block discarded – undo
30 30
         foreach ($_POST as $key => $text) {
31 31
             if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) {
32 32
                 $postData[$key] = iconv('Windows-1251', 'UTF-8', $text);
33
-            } else {
33
+            }
34
+            else {
34 35
                 $postData[$key] = $text;
35 36
             }
36 37
         }
37 38
         foreach ($_GET as $key => $text) {
38 39
             if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) {
39 40
                 $postData[$key] = iconv('Windows-1251', 'UTF-8', $text);
40
-            } else {
41
+            }
42
+            else {
41 43
                 $postData[$key] = $text;
42 44
             }
43 45
         }
@@ -72,7 +74,8 @@  discard block
 block discarded – undo
72 74
             }
73 75
             $pays = Money\Pay::getList(['where' => $where, 'order' => ['date_create', 'DESC']]);
74 76
             $this->view->page(['content' => 'pays', 'data' => compact('bread', 'pays')]);
75
-        } else {
77
+        }
78
+        else {
76 79
             $where = [['active', 1]];
77 80
             $where[] = [$pay->type, 1];
78 81
             $merchants = Money\Merchant::getList(['where' => $where]);
Please login to merge, or discard this patch.
system/modules/UserForms/UserForms.php 1 patch
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
         if (!empty($_POST['UserForms'])) {
16 16
             foreach ($_POST['UserForms'] as $form_id => $inputs) {
17 17
                 $form = \UserForms\Form::get((int) $form_id);
18
-                if (!$form)
19
-                    continue;
18
+                if (!$form) {
19
+                                    continue;
20
+                }
20 21
                 $formRecive = new \UserForms\Recive();
21 22
                 $formRecive->user_id = (int) \Users\User::$cur->id;
22 23
                 $formRecive->form_id = (int) $form_id;
@@ -25,10 +26,12 @@  discard block
 block discarded – undo
25 26
                 foreach ($form->inputs as $input) {
26 27
                     if (isset($inputs['input' . $input->id])) {
27 28
                         $data['input' . $input->id] = htmlspecialchars($inputs['input' . $input->id]);
28
-                    } elseif ($input->required) {
29
+                    }
30
+                    elseif ($input->required) {
29 31
                         $error = true;
30 32
                         Msg::add('Вы не заполнили поле: ' . $input->label);
31
-                    } else {
33
+                    }
34
+                    else {
32 35
                         $data['input' . $input->id] = '';
33 36
                     }
34 37
                 }
Please login to merge, or discard this patch.
system/modules/UserForms/widgets/userForm.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!empty($params[0])) {
2
+if (!empty($params[0])) {
3 3
     $form_id = $params[0];
4 4
 }
5
-if (empty($form_id)) {
5
+if (empty($form_id)) {
6 6
     echo('form not found');
7 7
     return;
8 8
 }
9 9
 $userForm = \UserForms\Form::get((int) $form_id);
10
-if (!$userForm) {
10
+if (!$userForm) {
11 11
     echo('form not found');
12 12
     return;
13 13
 }
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 $form->begin();
16 16
 ?>
17 17
 <?php
18
-if ($userForm->description) {
18
+if ($userForm->description) {
19 19
     echo "<p class = 'text-center'>{$userForm->description}</p>";
20 20
 }
21
-foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
21
+foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
22 22
     $form->input($input->type, 'UserForms[' . (int) $form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]);
23 23
 }
24 24
 ?>
Please login to merge, or discard this patch.
system/modules/Libs/Libs.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@  discard block
 block discarded – undo
28 28
                 foreach ($className::$files['css'] as $file) {
29 29
                     if (strpos($file, '/') === 0 || strpos($file, 'http') === 0) {
30 30
                         App::$cur->view->customAsset('css', $file, $libName);
31
-                    } else {
31
+                    }
32
+                    else {
32 33
                         App::$cur->view->customAsset('css', '/static/libs/vendor/' . ucfirst($libName) . '/' . $file, $libName);
33 34
                     }
34 35
                 }
@@ -37,7 +38,8 @@  discard block
 block discarded – undo
37 38
                 foreach ($className::$files['js'] as $file) {
38 39
                     if (strpos($file, '/') === 0 || strpos($file, 'http') === 0) {
39 40
                         App::$cur->view->customAsset('js', $file, $libName);
40
-                    } else {
41
+                    }
42
+                    else {
41 43
                         App::$cur->view->customAsset('js', '/static/libs/vendor/' . ucfirst($libName) . '/' . $file, $libName);
42 44
                     }
43 45
                 }
Please login to merge, or discard this patch.