Completed
Push — master ( 604db9...9db94b )
by Alexey
07:34
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/Config.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,11 +24,13 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function system()
26 26
     {
27
-        if (isset(self::$_configs['system']))
28
-            return self::$_configs['system'];
27
+        if (isset(self::$_configs['system'])) {
28
+                    return self::$_configs['system'];
29
+        }
29 30
 
30
-        if (!file_exists(INJI_SYSTEM_DIR . '/config/config.php'))
31
-            return [];
31
+        if (!file_exists(INJI_SYSTEM_DIR . '/config/config.php')) {
32
+                    return [];
33
+        }
32 34
 
33 35
         return self::$_configs['system'] = include INJI_SYSTEM_DIR . '/config/config.php';
34 36
     }
@@ -41,11 +43,13 @@  discard block
 block discarded – undo
41 43
      */
42 44
     public static function custom($path)
43 45
     {
44
-        if (isset(self::$_configs['custom'][$path]))
45
-            return self::$_configs['custom'][$path];
46
+        if (isset(self::$_configs['custom'][$path])) {
47
+                    return self::$_configs['custom'][$path];
48
+        }
46 49
 
47
-        if (!file_exists($path))
48
-            return [];
50
+        if (!file_exists($path)) {
51
+                    return [];
52
+        }
49 53
 
50 54
         return self::$_configs['custom'][$path] = include $path;
51 55
     }
@@ -61,12 +65,14 @@  discard block
 block discarded – undo
61 65
         if (!$app) {
62 66
             $app = App::$primary;
63 67
         }
64
-        if (isset(self::$_configs['app'][$app->name]))
65
-            return self::$_configs['app'][$app->name];
68
+        if (isset(self::$_configs['app'][$app->name])) {
69
+                    return self::$_configs['app'][$app->name];
70
+        }
66 71
 
67 72
         $path = $app->path . "/config/config.php";
68
-        if (!file_exists($path))
69
-            return array();
73
+        if (!file_exists($path)) {
74
+                    return array();
75
+        }
70 76
 
71 77
         return self::$_configs['app'][$app->name] = include $path;
72 78
     }
@@ -80,13 +86,15 @@  discard block
 block discarded – undo
80 86
     public static function share($module = '')
81 87
     {
82 88
         if ($module) {
83
-            if (isset($_configs['shareModules'][$module]))
84
-                return self::$_configs['shareModules'][$module];
89
+            if (isset($_configs['shareModules'][$module])) {
90
+                            return self::$_configs['shareModules'][$module];
91
+            }
85 92
 
86 93
             $path = INJI_PROGRAM_DIR . "/config/modules/{$module}.php";
87 94
         } else {
88
-            if (isset($_configs['share']))
89
-                return self::$_configs['share'];
95
+            if (isset($_configs['share'])) {
96
+                            return self::$_configs['share'];
97
+            }
90 98
 
91 99
             $path = INJI_PROGRAM_DIR . "/config/config.php";
92 100
         }
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   +48 added lines, -36 removed lines patch added patch discarded remove patch
@@ -680,17 +680,21 @@  discard block
 block discarded – undo
680 680
     {
681 681
 
682 682
         $return = array();
683
-        if (!empty($options['where']))
684
-            App::$cur->db->where($options['where']);
683
+        if (!empty($options['where'])) {
684
+                    App::$cur->db->where($options['where']);
685
+        }
685 686
         if (!empty($options['group'])) {
686 687
             App::$cur->db->group($options['group']);
687 688
         }
688
-        if (!empty($options['order']))
689
-            App::$cur->db->order($options['order']);
690
-        if (!empty($options['join']))
691
-            App::$cur->db->join($options['join']);
692
-        if (!empty($options['distinct']))
693
-            App::$cur->db->distinct = $options['distinct'];
689
+        if (!empty($options['order'])) {
690
+                    App::$cur->db->order($options['order']);
691
+        }
692
+        if (!empty($options['join'])) {
693
+                    App::$cur->db->join($options['join']);
694
+        }
695
+        if (!empty($options['distinct'])) {
696
+                    App::$cur->db->distinct = $options['distinct'];
697
+        }
694 698
 
695 699
         foreach (static::$relJoins as $join) {
696 700
             App::$cur->db->join($join[0], $join[1]);
@@ -716,14 +720,14 @@  discard block
 block discarded – undo
716 720
         }
717 721
         static::$needJoin = [];
718 722
 
719
-        if (!empty($options['limit']))
720
-            $limit = (int) $options['limit'];
721
-        else {
723
+        if (!empty($options['limit'])) {
724
+                    $limit = (int) $options['limit'];
725
+        } else {
722 726
             $limit = 0;
723 727
         }
724
-        if (!empty($options['start']))
725
-            $start = (int) $options['start'];
726
-        else {
728
+        if (!empty($options['start'])) {
729
+                    $start = (int) $options['start'];
730
+        } else {
727 731
             $start = 0;
728 732
         }
729 733
         if ($limit || $start) {
@@ -980,21 +984,23 @@  discard block
 block discarded – undo
980 984
             static::fixPrefix($options['where'], 'first');
981 985
         }
982 986
         $return = array();
983
-        if (!empty($options['where']))
984
-            App::$cur->db->where($options['where']);
985
-        if (!empty($options['join']))
986
-            App::$cur->db->join($options['join']);
987
+        if (!empty($options['where'])) {
988
+                    App::$cur->db->where($options['where']);
989
+        }
990
+        if (!empty($options['join'])) {
991
+                    App::$cur->db->join($options['join']);
992
+        }
987 993
         if (!empty($options['order'])) {
988 994
             App::$cur->db->order($options['order']);
989 995
         }
990
-        if (!empty($options['limit']))
991
-            $limit = (int) $options['limit'];
992
-        else {
996
+        if (!empty($options['limit'])) {
997
+                    $limit = (int) $options['limit'];
998
+        } else {
993 999
             $limit = 0;
994 1000
         }
995
-        if (!empty($options['start']))
996
-            $start = (int) $options['start'];
997
-        else {
1001
+        if (!empty($options['start'])) {
1002
+                    $start = (int) $options['start'];
1003
+        } else {
998 1004
             $start = 0;
999 1005
         }
1000 1006
         if ($limit || $start) {
@@ -1072,11 +1078,13 @@  discard block
 block discarded – undo
1072 1078
 
1073 1079
         $values = array();
1074 1080
         foreach ($cols as $col => $param) {
1075
-            if (isset($params[$col]))
1076
-                $values[$col] = $params[$col];
1081
+            if (isset($params[$col])) {
1082
+                            $values[$col] = $params[$col];
1083
+            }
1084
+        }
1085
+        if (!$values) {
1086
+                    return false;
1077 1087
         }
1078
-        if (!$values)
1079
-            return false;
1080 1088
 
1081 1089
 
1082 1090
         if ($where) {
@@ -1257,11 +1265,13 @@  discard block
 block discarded – undo
1257 1265
         $values = array();
1258 1266
 
1259 1267
         foreach ($this->cols() as $col => $param) {
1260
-            if (isset($this->_params[$col]))
1261
-                $values[$col] = $this->_params[$col];
1268
+            if (isset($this->_params[$col])) {
1269
+                            $values[$col] = $this->_params[$col];
1270
+            }
1271
+        }
1272
+        if (!$values && empty($options['empty'])) {
1273
+                    return false;
1262 1274
         }
1263
-        if (!$values && empty($options['empty']))
1264
-            return false;
1265 1275
 
1266 1276
         if ($this->pk()) {
1267 1277
             $new = false;
@@ -1417,8 +1427,9 @@  discard block
 block discarded – undo
1417 1427
     {
1418 1428
 
1419 1429
         foreach (static::relations() as $relName => $rel) {
1420
-            if ($rel['col'] == $col)
1421
-                return $relName;
1430
+            if ($rel['col'] == $col) {
1431
+                            return $relName;
1432
+            }
1422 1433
         }
1423 1434
         return NULL;
1424 1435
     }
@@ -1574,8 +1585,9 @@  discard block
 block discarded – undo
1574 1585
             App::$cur->db->where($relation['relTablePrefix'] . $this->index(), $this->pk());
1575 1586
             App::$cur->db->where($relation['relTablePrefix'] . $relation['model']::index(), $objectId);
1576 1587
             $isset = App::$cur->db->select($relation['relTable'])->fetch_assoc();
1577
-            if ($isset)
1578
-                return true;
1588
+            if ($isset) {
1589
+                            return true;
1590
+            }
1579 1591
 
1580 1592
             App::$cur->db->insert($relation['relTable'], [
1581 1593
                 $relation['relTablePrefix'] . $this->index() => $this->{$this->index()},
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/Dashboard/appAdminControllers/content/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
         }
10 10
 
11 11
         $widgetSize = !empty($section['size']) ? $section['size'] : 1;
12
-        $rowSum+=$widgetSize;
12
+        $rowSum += $widgetSize;
13 13
         ?>
14 14
         <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div>
15 15
         <?php
Please login to merge, or discard this patch.