Completed
Push — master ( ebb499...f17270 )
by Alexey
03:58
created
index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     }
36 36
 }
37 37
 
38
-require_once( INJI_SYSTEM_DIR . '/init.php' );
38
+require_once(INJI_SYSTEM_DIR . '/init.php');
39 39
 /**
40 40
  * System error messages
41 41
  */
Please login to merge, or discard this patch.
system/Inji/Html.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $html = "<{$tag}";
25 25
         if ($attributes && is_array($attributes)) {
26 26
             foreach ($attributes as $key => $value) {
27
-                $html .=" {$key} = '";
27
+                $html .= " {$key} = '";
28 28
                 if (!is_array($value)) {
29 29
                     $html .= addcslashes($value, "'");
30 30
                 } else {
Please login to merge, or discard this patch.
system/Inji/Log.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
                 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 87
             }
88 88
         }
89
-        echo '<tr><th>Summary</th><th>' . round(( microtime(true) - $this->startTime), 5) . '</th></tr>';
89
+        echo '<tr><th>Summary</th><th>' . round((microtime(true) - $this->startTime), 5) . '</th></tr>';
90 90
         echo '<tr><th>Memory</th><th>' . $this->convertSize(memory_get_peak_usage()) . ' of ' . ini_get('memory_limit') . '</th></tr></table></div>';
91 91
     }
92 92
 
Please login to merge, or discard this 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/Model.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1035,7 +1035,7 @@
 block discarded – undo
1035 1035
         } else {
1036 1036
             $cols .= '*';
1037 1037
         }
1038
-        $cols .=') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : '');
1038
+        $cols .= ') as `count`' . (!empty($options['cols']) ? ',' . $options['cols'] : '');
1039 1039
         App::$cur->db->cols = $cols;
1040 1040
         if (!empty($options['group'])) {
1041 1041
             App::$cur->db->group($options['group']);
Please login to merge, or discard this patch.
Braces   +39 added lines, -30 removed lines patch added patch discarded remove patch
@@ -898,22 +898,27 @@  discard block
 block discarded – undo
898 898
         if (!$query) {
899 899
             return [];
900 900
         }
901
-        if (!empty($options['where']))
902
-            $query->where($options['where']);
903
-        if (!empty($options['cols']))
904
-            $query->cols = $options['cols'];
901
+        if (!empty($options['where'])) {
902
+                    $query->where($options['where']);
903
+        }
904
+        if (!empty($options['cols'])) {
905
+                    $query->cols = $options['cols'];
906
+        }
905 907
         if (!empty($options['group'])) {
906 908
             $query->group($options['group']);
907 909
         }
908 910
         if (!empty($options['having'])) {
909 911
             $query->having($options['having']);
910 912
         }
911
-        if (!empty($options['order']))
912
-            $query->order($options['order']);
913
-        if (!empty($options['join']))
914
-            $query->join($options['join']);
915
-        if (!empty($options['distinct']))
916
-            $query->distinct = $options['distinct'];
913
+        if (!empty($options['order'])) {
914
+                    $query->order($options['order']);
915
+        }
916
+        if (!empty($options['join'])) {
917
+                    $query->join($options['join']);
918
+        }
919
+        if (!empty($options['distinct'])) {
920
+                    $query->distinct = $options['distinct'];
921
+        }
917 922
 
918 923
         foreach (static::$relJoins as $join) {
919 924
             $query->join($join[0], $join[1]);
@@ -939,14 +944,14 @@  discard block
 block discarded – undo
939 944
         }
940 945
         static::$needJoin = [];
941 946
 
942
-        if (!empty($options['limit']))
943
-            $limit = (int) $options['limit'];
944
-        else {
947
+        if (!empty($options['limit'])) {
948
+                    $limit = (int) $options['limit'];
949
+        } else {
945 950
             $limit = 0;
946 951
         }
947
-        if (!empty($options['start']))
948
-            $start = (int) $options['start'];
949
-        else {
952
+        if (!empty($options['start'])) {
953
+                    $start = (int) $options['start'];
954
+        } else {
950 955
             $start = 0;
951 956
         }
952 957
         if ($limit || $start) {
@@ -1221,21 +1226,23 @@  discard block
 block discarded – undo
1221 1226
         if (!empty($options['group'])) {
1222 1227
             static::fixPrefix($options['group'], 'first');
1223 1228
         }
1224
-        if (!empty($options['where']))
1225
-            $query->where($options['where']);
1226
-        if (!empty($options['join']))
1227
-            $query->join($options['join']);
1229
+        if (!empty($options['where'])) {
1230
+                    $query->where($options['where']);
1231
+        }
1232
+        if (!empty($options['join'])) {
1233
+                    $query->join($options['join']);
1234
+        }
1228 1235
         if (!empty($options['order'])) {
1229 1236
             $query->order($options['order']);
1230 1237
         }
1231
-        if (!empty($options['limit']))
1232
-            $limit = (int) $options['limit'];
1233
-        else {
1238
+        if (!empty($options['limit'])) {
1239
+                    $limit = (int) $options['limit'];
1240
+        } else {
1234 1241
             $limit = 0;
1235 1242
         }
1236
-        if (!empty($options['start']))
1237
-            $start = (int) $options['start'];
1238
-        else {
1243
+        if (!empty($options['start'])) {
1244
+                    $start = (int) $options['start'];
1245
+        } else {
1239 1246
             $start = 0;
1240 1247
         }
1241 1248
         if ($limit || $start) {
@@ -1312,8 +1319,9 @@  discard block
 block discarded – undo
1312 1319
 
1313 1320
         $values = [];
1314 1321
         foreach ($cols as $col => $param) {
1315
-            if (isset($params[$col]))
1316
-                $values[$col] = $params[$col];
1322
+            if (isset($params[$col])) {
1323
+                            $values[$col] = $params[$col];
1324
+            }
1317 1325
         }
1318 1326
         if (empty($values)) {
1319 1327
             return false;
@@ -1650,8 +1658,9 @@  discard block
 block discarded – undo
1650 1658
     public static function findRelation($col) {
1651 1659
 
1652 1660
         foreach (static::relations() as $relName => $rel) {
1653
-            if ($rel['col'] == $col)
1654
-                return $relName;
1661
+            if ($rel['col'] == $col) {
1662
+                            return $relName;
1663
+            }
1655 1664
         }
1656 1665
         return NULL;
1657 1666
     }
Please login to merge, or discard this patch.
system/Inji/Msg.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
             if (!empty($_SESSION['_INJI_MSG'])) {
23 23
                 foreach ($_SESSION['_INJI_MSG'] as $key => $msg) {
24 24
                     if ($msg['text'] == $text) {
25
-                        $msg['count'] ++;
25
+                        $msg['count']++;
26 26
                         return true;
27 27
                     }
28 28
                 }
Please login to merge, or discard this 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 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     static function uriParse($uri)
39 39
     {
40 40
         $answerPos = strpos($uri, '?');
41
-        $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri) )), 1);
41
+        $params = array_slice(explode('/', substr($uri, 0, $answerPos ? $answerPos : strlen($uri))), 1);
42 42
 
43 43
         foreach ($params as $key => $param) {
44 44
             if ($param != '') {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     static function resizeImage($img_path, $max_width = 1000, $max_height = 1000, $crop = false, $pos = 'center')
86 86
     {
87 87
         ini_set("gd.jpeg_ignore_warning", 1);
88
-        list( $img_width, $img_height, $img_type, $img_tag ) = getimagesize($img_path);
88
+        list($img_width, $img_height, $img_type, $img_tag) = getimagesize($img_path);
89 89
         switch ($img_type) {
90 90
             case 1:
91 91
                 $img_type = 'gif';
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 
109 109
         if ($crop === true || $crop == 'q') {
110 110
             if ($img_width > $img_height) {
111
-                $imgX = floor(( $img_width - $img_height ) / 2);
111
+                $imgX = floor(($img_width - $img_height) / 2);
112 112
                 $imgY = 0;
113 113
                 $img_width = $img_height;
114 114
                 $new_width = $max_width;
115 115
                 $new_height = $max_height;
116 116
             } else {
117 117
                 $imgX = 0;
118
-                $imgY = floor(( $img_height - $img_width ) / 2);
118
+                $imgY = floor(($img_height - $img_width) / 2);
119 119
                 $img_height = $img_width;
120 120
                 $new_width = $max_width;
121 121
                 $new_height = $max_height;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             $new_width = $max_width;
137 137
             $new_height = $max_height;
138 138
 //Находим начальные координаты (центрируем новое изображение)
139
-            $imgX = (int) (($ow / 2) - ($img_width / 2) );
139
+            $imgX = (int) (($ow / 2) - ($img_width / 2));
140 140
             if ($pos == 'center') {
141 141
                 $imgY = (int) (($oh / 2) - ($img_height / 2));
142 142
             } else {
Please login to merge, or discard this 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/Db/objects/Mysql/Mysql.php 2 patches
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.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 
14 14
 class Mysql extends \Object
15 15
 {
16
-    public $config = [];       // настройки подключения выбраной базы
17
-    public $connect = FALSE;        // ярлык соединения с MySQL
18
-    public $encoding = 'utf-8';        // установленная кодировка
19
-    public $db_name = 'test';         // выбраная в данный момент база
20
-    public $table_prefix = 'inji_';   // префикс названий таблиц
16
+    public $config = []; // настройки подключения выбраной базы
17
+    public $connect = FALSE; // ярлык соединения с MySQL
18
+    public $encoding = 'utf-8'; // установленная кодировка
19
+    public $db_name = 'test'; // выбраная в данный момент база
20
+    public $table_prefix = 'inji_'; // префикс названий таблиц
21 21
     public $pdo = NULL;
22 22
     public $lastQuery = '';
23 23
     public $last_error = '';
Please login to merge, or discard this patch.