Completed
Push — master ( f8c7e1...7855c2 )
by Alexey
06:00
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/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/Files/Files.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,16 +22,19 @@  discard block
 block discarded – undo
22 22
 
23 23
         $sitePath = App::$primary->path;
24 24
 
25
-        if (!is_uploaded_file($file['tmp_name']))
26
-            return 0;
25
+        if (!is_uploaded_file($file['tmp_name'])) {
26
+                    return 0;
27
+        }
27 28
 
28 29
         $fileinfo = pathinfo($file['name']);
29
-        if (empty($fileinfo['extension']))
30
-            return 0;
30
+        if (empty($fileinfo['extension'])) {
31
+                    return 0;
32
+        }
31 33
 
32 34
         $type = Files\Type::get($fileinfo['extension'], 'ext');
33
-        if (!$type)
34
-            return 0;
35
+        if (!$type) {
36
+                    return 0;
37
+        }
35 38
 
36 39
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
37 40
             return 0;
@@ -47,13 +50,15 @@  discard block
 block discarded – undo
47 50
         }
48 51
         $fileObject->name = $fileinfo['filename'];
49 52
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
50
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
51
-            unlink($sitePath . $fileObject->path);
53
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
54
+                    unlink($sitePath . $fileObject->path);
55
+        }
52 56
 
53 57
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
54 58
 
55
-        if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path))
56
-            return false;
59
+        if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) {
60
+                    return false;
61
+        }
57 62
 
58 63
         $fileObject->type_id = $type->pk();
59 64
         $fileObject->original_name = $file['name'];
@@ -76,12 +81,14 @@  discard block
 block discarded – undo
76 81
         $sitePath = App::$primary->path;
77 82
 
78 83
         $fileinfo = pathinfo($url);
79
-        if (empty($fileinfo['extension']))
80
-            return 0;
84
+        if (empty($fileinfo['extension'])) {
85
+                    return 0;
86
+        }
81 87
 
82 88
         $type = Files\Type::get($fileinfo['extension'], 'ext');
83
-        if (!$type)
84
-            return 0;
89
+        if (!$type) {
90
+                    return 0;
91
+        }
85 92
 
86 93
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
87 94
             return 0;
@@ -97,8 +104,9 @@  discard block
 block discarded – undo
97 104
         }
98 105
         $fileObject->name = $fileinfo['filename'];
99 106
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
100
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
101
-            unlink($sitePath . $fileObject->path);
107
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
108
+                    unlink($sitePath . $fileObject->path);
109
+        }
102 110
 
103 111
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
104 112
 
Please login to merge, or discard this patch.
system/modules/Modules/appAdminControllers/content/install.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
     $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2);
7 7
     foreach ($systemModules as $module) {
8 8
         $info = Module::getInfo($module);
9
-        if (!$info || isset($modules[$module]))
10
-            continue;
9
+        if (!$info || isset($modules[$module])) {
10
+                    continue;
11
+        }
11 12
         ?>
12 13
         <div class ="form-group">
13 14
             <div class="checkbox">
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/Robokassa.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@
 block discarded – undo
25 25
 
26 26
         $result['payId'] = $data["InvId"];
27 27
 
28
-        if (strtolower($data['SignatureValue']) == $hashGenerated)
29
-            $result['status'] = 'success';
28
+        if (strtolower($data['SignatureValue']) == $hashGenerated) {
29
+                    $result['status'] = 'success';
30
+        }
30 31
 
31 32
         return $result;
32 33
     }
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/WalletOne.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,20 +28,24 @@  discard block
 block discarded – undo
28 28
 
29 29
         // Проверка наличия необходимых параметров в POST-запросе
30 30
 
31
-        if (!isset($data["WMI_SIGNATURE"]))
32
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE");
31
+        if (!isset($data["WMI_SIGNATURE"])) {
32
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_SIGNATURE");
33
+        }
33 34
 
34
-        if (!isset($data["WMI_PAYMENT_NO"]))
35
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO");
35
+        if (!isset($data["WMI_PAYMENT_NO"])) {
36
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_PAYMENT_NO");
37
+        }
36 38
 
37
-        if (!isset($data["WMI_ORDER_STATE"]))
38
-            $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE");
39
+        if (!isset($data["WMI_ORDER_STATE"])) {
40
+                    $result['callback'] = print_answer("Retry", "Отсутствует параметр WMI_ORDER_STATE");
41
+        }
39 42
 
40 43
         // Извлечение всех параметров POST-запроса, кроме WMI_SIGNATURE
41 44
         $params = [];
42 45
         foreach ($data as $name => $value) {
43
-            if ($name !== "WMI_SIGNATURE")
44
-                $params[$name] = $value;
46
+            if ($name !== "WMI_SIGNATURE") {
47
+                            $params[$name] = $value;
48
+            }
45 49
         }
46 50
 
47 51
         // Сортировка массива по именам ключей в порядке возрастания
@@ -86,8 +90,9 @@  discard block
 block discarded – undo
86 90
         $config = static::getConfig();
87 91
         $merchantCurrency = static::getMerchantCurrency($currency);
88 92
         
89
-        if (!$description)
90
-            $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
93
+        if (!$description) {
94
+                    $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
95
+        }
91 96
 
92 97
         //Секретный ключ интернет-магазина
93 98
         $key = $config['secret'];
@@ -117,11 +122,12 @@  discard block
 block discarded – undo
117 122
         $fieldValues = "";
118 123
 
119 124
         foreach ($fields as $value) {
120
-            if (is_array($value))
121
-                foreach ($value as $v) {
125
+            if (is_array($value)) {
126
+                            foreach ($value as $v) {
122 127
                     //Конвертация из текущей кодировки (UTF-8)
123 128
                     //необходима только если кодировка магазина отлична от Windows-1251
124 129
                     $v = iconv("utf-8", "windows-1251", $v);
130
+            }
125 131
                     $fieldValues .= $v;
126 132
                 } else {
127 133
                 //Конвертация из текущей кодировки (UTF-8)
Please login to merge, or discard this patch.