Completed
Push — master ( f81666...55a9f3 )
by Alexey
05:42
created
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 3 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   +42 added lines, -32 removed lines patch added patch discarded remove patch
@@ -685,17 +685,21 @@  discard block
 block discarded – undo
685 685
      */
686 686
     public static function get_list($options = [])
687 687
     {
688
-        if (!empty($options['where']))
689
-            App::$cur->db->where($options['where']);
688
+        if (!empty($options['where'])) {
689
+                    App::$cur->db->where($options['where']);
690
+        }
690 691
         if (!empty($options['group'])) {
691 692
             App::$cur->db->group($options['group']);
692 693
         }
693
-        if (!empty($options['order']))
694
-            App::$cur->db->order($options['order']);
695
-        if (!empty($options['join']))
696
-            App::$cur->db->join($options['join']);
697
-        if (!empty($options['distinct']))
698
-            App::$cur->db->distinct = $options['distinct'];
694
+        if (!empty($options['order'])) {
695
+                    App::$cur->db->order($options['order']);
696
+        }
697
+        if (!empty($options['join'])) {
698
+                    App::$cur->db->join($options['join']);
699
+        }
700
+        if (!empty($options['distinct'])) {
701
+                    App::$cur->db->distinct = $options['distinct'];
702
+        }
699 703
 
700 704
         foreach (static::$relJoins as $join) {
701 705
             App::$cur->db->join($join[0], $join[1]);
@@ -721,14 +725,14 @@  discard block
 block discarded – undo
721 725
         }
722 726
         static::$needJoin = [];
723 727
 
724
-        if (!empty($options['limit']))
725
-            $limit = (int) $options['limit'];
726
-        else {
728
+        if (!empty($options['limit'])) {
729
+                    $limit = (int) $options['limit'];
730
+        } else {
727 731
             $limit = 0;
728 732
         }
729
-        if (!empty($options['start']))
730
-            $start = (int) $options['start'];
731
-        else {
733
+        if (!empty($options['start'])) {
734
+                    $start = (int) $options['start'];
735
+        } else {
732 736
             $start = 0;
733 737
         }
734 738
         if ($limit || $start) {
@@ -983,21 +987,23 @@  discard block
 block discarded – undo
983 987
         if (!empty($options['where'])) {
984 988
             static::fixPrefix($options['where'], 'first');
985 989
         }
986
-        if (!empty($options['where']))
987
-            App::$cur->db->where($options['where']);
988
-        if (!empty($options['join']))
989
-            App::$cur->db->join($options['join']);
990
+        if (!empty($options['where'])) {
991
+                    App::$cur->db->where($options['where']);
992
+        }
993
+        if (!empty($options['join'])) {
994
+                    App::$cur->db->join($options['join']);
995
+        }
990 996
         if (!empty($options['order'])) {
991 997
             App::$cur->db->order($options['order']);
992 998
         }
993
-        if (!empty($options['limit']))
994
-            $limit = (int) $options['limit'];
995
-        else {
999
+        if (!empty($options['limit'])) {
1000
+                    $limit = (int) $options['limit'];
1001
+        } else {
996 1002
             $limit = 0;
997 1003
         }
998
-        if (!empty($options['start']))
999
-            $start = (int) $options['start'];
1000
-        else {
1004
+        if (!empty($options['start'])) {
1005
+                    $start = (int) $options['start'];
1006
+        } else {
1001 1007
             $start = 0;
1002 1008
         }
1003 1009
         if ($limit || $start) {
@@ -1075,8 +1081,9 @@  discard block
 block discarded – undo
1075 1081
 
1076 1082
         $values = [];
1077 1083
         foreach ($cols as $col => $param) {
1078
-            if (isset($params[$col]))
1079
-                $values[$col] = $params[$col];
1084
+            if (isset($params[$col])) {
1085
+                            $values[$col] = $params[$col];
1086
+            }
1080 1087
         }
1081 1088
         if (empty($values)) {
1082 1089
             return false;
@@ -1259,8 +1266,9 @@  discard block
 block discarded – undo
1259 1266
         $values = [];
1260 1267
 
1261 1268
         foreach ($this->cols() as $col => $param) {
1262
-            if (isset($this->_params[$col]))
1263
-                $values[$col] = $this->_params[$col];
1269
+            if (isset($this->_params[$col])) {
1270
+                            $values[$col] = $this->_params[$col];
1271
+            }
1264 1272
         }
1265 1273
         if (empty($values) && empty($options['empty'])) {
1266 1274
             return false;
@@ -1420,8 +1428,9 @@  discard block
 block discarded – undo
1420 1428
     {
1421 1429
 
1422 1430
         foreach (static::relations() as $relName => $rel) {
1423
-            if ($rel['col'] == $col)
1424
-                return $relName;
1431
+            if ($rel['col'] == $col) {
1432
+                            return $relName;
1433
+            }
1425 1434
         }
1426 1435
         return NULL;
1427 1436
     }
@@ -1577,8 +1586,9 @@  discard block
 block discarded – undo
1577 1586
             App::$cur->db->where($relation['relTablePrefix'] . $this->index(), $this->pk());
1578 1587
             App::$cur->db->where($relation['relTablePrefix'] . $relation['model']::index(), $objectId);
1579 1588
             $isset = App::$cur->db->select($relation['relTable'])->fetch_assoc();
1580
-            if ($isset)
1581
-                return true;
1589
+            if ($isset) {
1590
+                            return true;
1591
+            }
1582 1592
 
1583 1593
             App::$cur->db->insert($relation['relTable'], [
1584 1594
                 $relation['relTablePrefix'] . $this->index() => $this->{$this->index()},
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
     /**
358 358
      * Information extractor for col relations path
359 359
      * 
360
-     * @param string|array $info
360
+     * @param string $info
361 361
      * @return array
362 362
      */
363 363
     public static function parseColRecursion($info)
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      * Generate params string for col by name
434 434
      * 
435 435
      * @param string $colName
436
-     * @return boolean|string
436
+     * @return false|string
437 437
      */
438 438
     public static function genColParams($colName)
439 439
     {
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
     /**
574 574
      * return relations list
575 575
      * 
576
-     * @return array
576
+     * @return string
577 577
      */
578 578
     public static function relations()
579 579
     {
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
      * 
1066 1066
      * @param array $params
1067 1067
      * @param array $where
1068
-     * @return boolean
1068
+     * @return false|null
1069 1069
      */
1070 1070
     public static function update($params, $where = [])
1071 1071
     {
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/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/Callbacks/appControllers/content/index.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <div class = 'callbacks'>
2 2
   <h1>Отзывы</h1>
3 3
   <?php
4
-  $callbacks = Callbacks\Callback::getList(['where' => ['view', '1'], 'order' => ['weight', 'asc']]);
5
-  foreach ($callbacks as $callback) {
6
-      echo "<h3>{$callback->name}<div class = 'time'>{$callback->date_create}</div></h3>";
7
-      echo "<p>" . nl2br($callback->text) . "</p>";
8
-  }
9
-  ?>
4
+    $callbacks = Callbacks\Callback::getList(['where' => ['view', '1'], 'order' => ['weight', 'asc']]);
5
+    foreach ($callbacks as $callback) {
6
+        echo "<h3>{$callback->name}<div class = 'time'>{$callback->date_create}</div></h3>";
7
+        echo "<p>" . nl2br($callback->text) . "</p>";
8
+    }
9
+    ?>
10 10
 </div>
11 11
 <h3>Можете и вы в свободной форме оставить свой отзыв</h3>
12 12
 <?php
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.
system/modules/Dashboard/appAdminControllers/content/siteConfig.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@
 block discarded – undo
17 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']; ?>' />
18 18
   </div>
19 19
   <?php
20
-  $form = new Ui\Form();
21
-  $form->input('image', 'site_logo', 'Лого сайта', ['value' => !empty(\App::$primary->config['site']['site_logo']) ? \App::$primary->config['site']['site_logo'] : '']);
22
-  ?>
20
+    $form = new Ui\Form();
21
+    $form->input('image', 'site_logo', 'Лого сайта', ['value' => !empty(\App::$primary->config['site']['site_logo']) ? \App::$primary->config['site']['site_logo'] : '']);
22
+    ?>
23 23
   <h2>Дополнительные мета теги</h2>
24 24
   <div class ="form-group">
25 25
     <button type = 'button' class = 'btn btn-primary ' onclick = 'addMeta()'>Добавить <i class = 'glyphicon glyphicon-plus'></i></button>
Please login to merge, or discard this 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 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
     function newQuery()
57 57
     {
58
-        if($this->QueryClassName) {
58
+        if ($this->QueryClassName) {
59 59
             return new $this->QueryClassName($this->connection);
60 60
         }
61 61
         return false;
Please login to merge, or discard this 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.