Completed
Push — master ( 97b00d...004fa5 )
by Alexey
07:14
created
system/Inji/Log.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -79,10 +79,12 @@  discard block
 block discarded – undo
79 79
             if (!empty($log['status'])) {
80 80
                 echo "<tr class = '{$log['status']}'><td>{$log['name']}</td><td>{$log['status']}</td></tr>";
81 81
             } else {
82
-                if (empty($log['end']))
83
-                    $log['end'] = microtime(true);
84
-                if (empty($log['start']))
85
-                    $log['start'] = microtime(true);
82
+                if (empty($log['end'])) {
83
+                                    $log['end'] = microtime(true);
84
+                }
85
+                if (empty($log['start'])) {
86
+                                    $log['start'] = microtime(true);
87
+                }
86 88
                 echo "<tr><td>{$log['name']}</td><td" . (round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '') . ">" . round(($log['end'] - $log['start']), 5) . "</td></tr>";
87 89
             }
88 90
         }
@@ -93,12 +95,13 @@  discard block
 block discarded – undo
93 95
     function convertSize($size)
94 96
     {
95 97
 
96
-        if ($size < 1024)
97
-            return $size . "B";
98
-        elseif ($size < 1048576)
99
-            return round($size / 1024, 2) . "KB";
100
-        else
101
-            return round($size / 1048576, 2) . "MB";
98
+        if ($size < 1024) {
99
+                    return $size . "B";
100
+        } elseif ($size < 1048576) {
101
+                    return round($size / 1024, 2) . "KB";
102
+        } else {
103
+                    return round($size / 1048576, 2) . "MB";
104
+        }
102 105
     }
103 106
 
104 107
     function __destruct()
Please login to merge, or discard this patch.
system/Inji/Msg.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,9 @@
 block discarded – undo
52 52
      */
53 53
     static function get($clean = false)
54 54
     {
55
-        if (empty($_SESSION['_INJI_MSG']))
56
-            return [];
55
+        if (empty($_SESSION['_INJI_MSG'])) {
56
+                    return [];
57
+        }
57 58
         $msgs = $_SESSION['_INJI_MSG'];
58 59
         if ($clean) {
59 60
             $_SESSION['_INJI_MSG'] = [];
Please login to merge, or discard this patch.
system/Inji/Tools.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,8 +58,9 @@  discard block
 block discarded – undo
58 58
      */
59 59
     static function createDir($path)
60 60
     {
61
-        if (file_exists($path))
62
-            return true;
61
+        if (file_exists($path)) {
62
+                    return true;
63
+        }
63 64
 
64 65
         $path = explode('/', $path);
65 66
         $cur = '';
@@ -101,10 +102,11 @@  discard block
 block discarded – undo
101 102
         $imagecreatefromX = "imagecreatefrom{$img_type}";
102 103
         $src_res = $imagecreatefromX($img_path);
103 104
 
104
-        if ($img_width / $max_width > $img_height / $max_height)
105
-            $separator = $img_width / $max_width;
106
-        else
107
-            $separator = $img_height / $max_height;
105
+        if ($img_width / $max_width > $img_height / $max_height) {
106
+                    $separator = $img_width / $max_width;
107
+        } else {
108
+                    $separator = $img_height / $max_height;
109
+        }
108 110
 
109 111
         if ($crop === true || $crop == 'q') {
110 112
             if ($img_width > $img_height) {
Please login to merge, or discard this patch.
system/modules/Access/Access.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
         if (!$app) {
16 16
             $app = $this->app->type;
17 17
         }
18
-        if (!empty($this->config['access']['accessTree'][$app]['deniedUrl']))
19
-            return $this->config['access']['accessTree'][$app]['deniedUrl'];
18
+        if (!empty($this->config['access']['accessTree'][$app]['deniedUrl'])) {
19
+                    return $this->config['access']['accessTree'][$app]['deniedUrl'];
20
+        }
20 21
 
21 22
         return '/';
22 23
     }
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
             return true;
51 52
         }
52 53
 
53
-        if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access)))
54
-            return false;
54
+        if ((!$user->group_id && !empty($access)) || ($user->group_id && !empty($access) && !in_array($user->group_id, $access))) {
55
+                    return false;
56
+        }
55 57
 
56 58
         return true;
57 59
     }
Please login to merge, or discard this patch.
system/modules/Dashboard/appAdminControllers/content/siteConfig.php 1 patch
Braces   +16 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,19 +2,31 @@
 block discarded – undo
2 2
 <form action = '' method = 'POST' enctype="multipart/form-data">
3 3
   <div class ="form-group">
4 4
     <label>Название сайта</label>
5
-    <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) echo \App::$primary->config['site']['name']; ?>' />
5
+    <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) {
6
+    echo \App::$primary->config['site']['name'];
7
+}
8
+?>' />
6 9
   </div>
7 10
   <div class ="form-group">
8 11
     <label>Контактный email</label>
9
-    <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' />
12
+    <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) {
13
+    echo \App::$primary->config['site']['email'];
14
+}
15
+?>' />
10 16
   </div>
11 17
   <div class ="form-group">
12 18
     <label>Ключевые слова</label>
13
-    <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' />
19
+    <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) {
20
+    echo \App::$primary->config['site']['keywords'];
21
+}
22
+?>' />
14 23
   </div>
15 24
   <div class ="form-group">
16 25
     <label>Краткое описание сайта</label>
17
-    <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' />
26
+    <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) {
27
+    echo \App::$primary->config['site']['description'];
28
+}
29
+?>' />
18 30
   </div>
19 31
   <?php
20 32
   $form = new Ui\Form();
Please login to merge, or discard this patch.
system/modules/Db/Db.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
             $param = isset($this->config['default']) ? $this->config['default'] : 'local';
17 17
         }
18 18
         if (!is_array($param)) {
19
-            if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true])))
20
-                return false;
19
+            if (!($dbOption = Db\Options::get($param, 'connect_alias', ['array' => true]))) {
20
+                            return false;
21
+            }
21 22
 
22 23
             $db = $dbOption;
23 24
         } else {
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Mysql.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,14 +30,18 @@
 block discarded – undo
30 30
     public function init($connect_options)
31 31
     {
32 32
         extract($connect_options);
33
-        if (isset($db_name))
34
-            $this->db_name = $db_name;
35
-        if (isset($encoding))
36
-            $this->encoding = $encoding;
37
-        if (isset($table_prefix))
38
-            $this->table_prefix = $table_prefix;
39
-        if (isset($noConnectAbort))
40
-            $this->noConnectAbort = $noConnectAbort;
33
+        if (isset($db_name)) {
34
+                    $this->db_name = $db_name;
35
+        }
36
+        if (isset($encoding)) {
37
+                    $this->encoding = $encoding;
38
+        }
39
+        if (isset($table_prefix)) {
40
+                    $this->table_prefix = $table_prefix;
41
+        }
42
+        if (isset($noConnectAbort)) {
43
+                    $this->noConnectAbort = $noConnectAbort;
44
+        }
41 45
 
42 46
         $dsn = "mysql:host=$host;port=$port;dbname=$db_name;charset=$encoding";
43 47
         $dt = new \DateTime();
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Query.php 1 patch
Braces   +59 added lines, -46 removed lines patch added patch discarded remove patch
@@ -126,12 +126,14 @@  discard block
 block discarded – undo
126 126
         if (!is_array($order)) {
127 127
             $this->order[] = "{$order} {$type}";
128 128
         } else {
129
-            foreach ($order as $item)
130
-                if (!is_array($item)) {
129
+            foreach ($order as $item) {
130
+                            if (!is_array($item)) {
131 131
                     call_user_func_array(array($this, 'order'), $order);
132
+            }
132 133
                     break;
133
-                } else
134
-                    $this->order($item);
134
+                } else {
135
+                                    $this->order($item);
136
+                }
135 137
         }
136 138
     }
137 139
 
@@ -140,8 +142,9 @@  discard block
 block discarded – undo
140 142
         $start = intval($start);
141 143
         $len = intval($len);
142 144
         $this->limit = "LIMIT {$start}";
143
-        if ($len !== 0)
144
-            $this->limit .= ",{$len}";
145
+        if ($len !== 0) {
146
+                    $this->limit .= ",{$len}";
147
+        }
145 148
     }
146 149
 
147 150
     function buildJoin($table, $where = false, $type = 'LEFT', $alias = '')
@@ -154,10 +157,12 @@  discard block
 block discarded – undo
154 157
             }
155 158
         } else {
156 159
             $join .= " {$type} JOIN {$this->curInstance->table_prefix}{$table}";
157
-            if ($alias)
158
-                $join .= " AS `{$alias}`";
159
-            if ($where)
160
-                $join .= " ON {$where}";
160
+            if ($alias) {
161
+                            $join .= " AS `{$alias}`";
162
+            }
163
+            if ($where) {
164
+                            $join .= " ON {$where}";
165
+            }
161 166
         }
162 167
         return $join;
163 168
     }
@@ -166,69 +171,77 @@  discard block
 block discarded – undo
166 171
     {
167 172
         $params = [];
168 173
         if (!is_array($where)) {
169
-            if (!$operation)
170
-                $operation = '=';
174
+            if (!$operation) {
175
+                            $operation = '=';
176
+            }
171 177
 
172
-            if ($concatenation === false)
173
-                $concatenation = 'AND';
174
-            elseif ($concatenation === true)
175
-                $concatenation = '';
178
+            if ($concatenation === false) {
179
+                            $concatenation = 'AND';
180
+            } elseif ($concatenation === true) {
181
+                            $concatenation = '';
182
+            }
176 183
 
177
-            if ($this->whereString == NULL)
178
-                $this->whereString = ' WHERE ';
184
+            if ($this->whereString == NULL) {
185
+                            $this->whereString = ' WHERE ';
186
+            }
179 187
 
180 188
             if (stristr($operation, 'IN') || stristr($operation, 'NOT IN')) {
181
-                if (!preg_match('!\(!', $value) && !preg_match('![^0-9,\.\(\) ]!', $value))
182
-                    $value = "({$value})";
183
-                elseif (preg_match('!\(!', $value) && preg_match('![^0-9,\.\(\) ]!', $value))
184
-                    $value = "\"{$value}\"";
185
-            }
186
-            elseif (!in_array($value, array('CURRENT_TIMESTAMP'))) {
189
+                if (!preg_match('!\(!', $value) && !preg_match('![^0-9,\.\(\) ]!', $value)) {
190
+                                    $value = "({$value})";
191
+                } elseif (preg_match('!\(!', $value) && preg_match('![^0-9,\.\(\) ]!', $value)) {
192
+                                    $value = "\"{$value}\"";
193
+                }
194
+            } elseif (!in_array($value, array('CURRENT_TIMESTAMP'))) {
187 195
                 $this->params[] = $value;
188 196
                 $value = "?";
189 197
             }
190 198
 
191
-            if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ')
192
-                $this->whereString .= " {$where} {$operation} {$value} ";
193
-            else
194
-                $this->whereString .= "{$concatenation} {$where} {$operation} {$value} ";
195
-        }
196
-        else {
199
+            if (substr($this->whereString, -1, 1) == '(' || substr($this->whereString, -2, 2) == 'E ') {
200
+                            $this->whereString .= " {$where} {$operation} {$value} ";
201
+            } else {
202
+                            $this->whereString .= "{$concatenation} {$where} {$operation} {$value} ";
203
+            }
204
+        } else {
197 205
             $i = -1;
198 206
             while (isset($where[++$i])) {
199 207
                 $item = $where[$i];
200 208
                 if (isset($where[$i + 1]) && !isset($where[$i - 1]) && is_array($where[$i])) {
201 209
                     if ($this->whereString != NULL && substr($this->whereString, -1, 1) != '(' && $this->whereString != 'WHERE ') {
202
-                        if (!isset($item[3]))
203
-                            $concatenation = 'AND';
204
-                        else
205
-                            $concatenation = $item[3];
210
+                        if (!isset($item[3])) {
211
+                                                    $concatenation = 'AND';
212
+                        } else {
213
+                                                    $concatenation = $item[3];
214
+                        }
206 215
 
207 216
                         $this->whereString .= "{$concatenation} ";
208 217
                     }
209 218
 
210
-                    if ($this->whereString != NULL)
211
-                        $this->whereString .= '(';
212
-                    else
213
-                        $this->whereString = 'WHERE (';
219
+                    if ($this->whereString != NULL) {
220
+                                            $this->whereString .= '(';
221
+                    } else {
222
+                                            $this->whereString = 'WHERE (';
223
+                    }
214 224
                 }
215 225
 
216 226
                 if (!is_array($item)) {
217 227
                     call_user_func_array(array($this, 'buildWhere'), $where);
218 228
                     break;
219 229
                 } else {
220
-                    if ($this->whereString != NULL && substr($this->whereString, -1, 1) != '(')
221
-                        if (!isset($item[3]))
230
+                    if ($this->whereString != NULL && substr($this->whereString, -1, 1) != '(') {
231
+                                            if (!isset($item[3]))
222 232
                             $concatenation = 'AND';
223
-                        else
224
-                            $concatenation = $item[3];
225
-                    elseif (substr($this->whereString, -1, 1) != '(')
226
-                        $this->whereString = 'WHERE ';
233
+                    } else {
234
+                                                    $concatenation = $item[3];
235
+                        }
236
+                    elseif (substr($this->whereString, -1, 1) != '(') {
237
+                                            $this->whereString = 'WHERE ';
238
+                    }
227 239
 
228 240
                     $this->buildWhere($item);
229 241
                 }
230
-                if (!isset($where[$i + 1]) && isset($where[$i - 1]))
231
-                    $this->whereString .= ') ';
242
+                if (!isset($where[$i + 1]) && isset($where[$i - 1])) {
243
+                                    $this->whereString .= ') ';
244
+                }
232 245
             }
233 246
         }
234 247
     }
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/CartController.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -271,10 +271,11 @@  discard block
 block discarded – undo
271 271
         $item->sales ++;
272 272
         $item->save();
273 273
 
274
-        if (empty($_GET['count']))
275
-            $count = 1;
276
-        else
277
-            $count = (float) $_GET['count'];
274
+        if (empty($_GET['count'])) {
275
+                    $count = 1;
276
+        } else {
277
+                    $count = (float) $_GET['count'];
278
+        }
278 279
 
279 280
         $cart = $this->ecommerce->getCurCart();
280 281
 
@@ -313,8 +314,9 @@  discard block
 block discarded – undo
313 314
 
314 315
     function delcartitemAction($cci_id = 0)
315 316
     {
316
-        if (empty($_SESSION['cart']['cart_id']))
317
-            exit('У вас нет корзины');
317
+        if (empty($_SESSION['cart']['cart_id'])) {
318
+                    exit('У вас нет корзины');
319
+        }
318 320
         $cartItem = \Ecommerce\Cart\Item::get((int) $cci_id);
319 321
         if (!$cartItem || $cartItem->cart_id != $_SESSION['cart']['cart_id']) {
320 322
             exit('Этот элемент корзины не относится к вашей корзине');
Please login to merge, or discard this patch.