Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Money/widgets/cabinet/rewards.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
             <h3>Уровни начислений</h3>
13 13
             <ul>
14 14
               <?php
15
-              foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
16
-                  ?>
15
+                foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
16
+                    ?>
17 17
 
18 18
                     <li><?= !$level->level ? 'Личный' : $level->level; ?>. <?= $types[$level->type]['viewer']($level); ?></li>
19 19
                     <?php
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
                 <h4 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h4>
35 35
                 <ul>
36 36
                   <?php
37
-                  foreach ($condition->items as $item) {
38
-                      $itemComplete = $item->checkComplete();
39
-                      switch ($item->type) {
40
-                          case 'event':
37
+                    foreach ($condition->items as $item) {
38
+                        $itemComplete = $item->checkComplete();
39
+                        switch ($item->type) {
40
+                            case 'event':
41 41
                               $name = \Events\Event::get($item->value, 'event')->name();
42
-                              break;
43
-                      }
44
-                      ?>
42
+                                break;
43
+                        }
44
+                        ?>
45 45
                         <li> 
46 46
                             <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount(); ?></b>/<?= $item->count; ?> <br />
47 47
                         </li>
Please login to merge, or discard this patch.
system/modules/Money/models/Wallet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         'manager' => [
43 43
             'cols' => ['user:id', 'user_id', 'currency_id', 'amount'],
44 44
             'sortable' => ['user:id', 'user_id', 'currency_id', 'amount'],
45
-            'filters' => [ 'currency_id'],
45
+            'filters' => ['currency_id'],
46 46
         ]
47 47
     ];
48 48
 
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 2 patches
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.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@
 block discarded – undo
28 28
     public function reciverAction($system = '', $status = '') {
29 29
         $postData = [];
30 30
         foreach ($_POST as $key => $text) {
31
-            if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) {
31
+            if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), true)) {
32 32
                 $postData[$key] = iconv('Windows-1251', 'UTF-8', $text);
33 33
             } else {
34 34
                 $postData[$key] = $text;
35 35
             }
36 36
         }
37 37
         foreach ($_GET as $key => $text) {
38
-            if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), TRUE)) {
38
+            if (!is_array($text) && !mb_detect_encoding($text, array('UTF-8'), true)) {
39 39
                 $postData[$key] = iconv('Windows-1251', 'UTF-8', $text);
40 40
             } else {
41 41
                 $postData[$key] = $text;
Please login to merge, or discard this patch.
system/modules/Money/appControllers/content/pay.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
                     </td>
24 24
                     <td>
25 25
                       <?php
26
-                      foreach ($allowCurrencies as $allowCurrency) {
27
-                          $className = 'Money\MerchantHelper\\' . $merchant->object_name;
28
-                          $sum = $className::getFinalSum($pay, $allowCurrency);
29
-                          ?>
26
+                        foreach ($allowCurrencies as $allowCurrency) {
27
+                            $className = 'Money\MerchantHelper\\' . $merchant->object_name;
28
+                            $sum = $className::getFinalSum($pay, $allowCurrency);
29
+                            ?>
30 30
                             <b><?= $allowCurrency['currency']->name(); ?></b>
31 31
                             <a class="btn btn-primary" href ="/money/merchants/go/<?= $pay->id; ?>/<?= $merchant->id; ?>/<?= $allowCurrency['currency']->id; ?>">Оплатить <?= $sum; ?> <?= $allowCurrency['currency']->acronym(); ?></a>
32 32
                             <?php
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/Notifications/Notifications.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@
 block discarded – undo
71 71
         if (empty($_COOKIE['notification-device'])) {
72 72
             $deviceKey = Tools::randomString(70);
73 73
             setcookie("notification-device", $deviceKey, time() + 360000, "/");
74
-        } else {
74
+        }
75
+        else {
75 76
             $deviceKey = $_COOKIE['notification-device'];
76 77
             setcookie("notification-device", $_COOKIE['notification-device'], time() + 360000, "/");
77 78
         }
Please login to merge, or discard this patch.