Passed
Branchmaster (6e8442)
by Plamen
01:31
created
table_request.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         if (($col = filter_input(INPUT_GET, 'col', FILTER_VALIDATE_INT))) {
39 39
             return isset(self::$cols[$col][2]['sort']) ?
40
-                    self::$cols[$col][2]['sort'] :
41
-                    self::$cols[$col][1];
40
+                    self::$cols[$col][2]['sort'] : self::$cols[$col][1];
42 41
         }
43 42
         return self::$t['order']['col'];
44 43
     }
@@ -47,8 +46,7 @@  discard block
 block discarded – undo
47 46
     {
48 47
         $reset = filter_has_var(INPUT_GET, 'col') ? 'asc' : null;
49 48
         return in_array(filter_input(INPUT_GET, 'ord'), ['asc', 'desc']) ?
50
-                filter_input(INPUT_GET, 'ord') :
51
-                ($reset ?: self::$t['order']['dir']);
49
+                filter_input(INPUT_GET, 'ord') : ($reset ?: self::$t['order']['dir']);
52 50
     }
53 51
 
54 52
     private static function requestExport()
@@ -60,7 +58,6 @@  discard block
 block discarded – undo
60 58
     private static function requestPage()
61 59
     {
62 60
         return filter_has_var(INPUT_GET, 'pg') && self::$export == false ?
63
-                (int) filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) :
64
-                self::$t['page'];
61
+                (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : self::$t['page'];
65 62
     }
66 63
 }
Please login to merge, or discard this patch.
table_setter.php 1 patch
Spacing   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             switch (gettype($c)) {
55 55
                 case 'array';
56 56
                     foreach ($c as $k => $v) {
57
-                        self::$config[$k] = $getValid((string) $k, $v);
57
+                        self::$config[$k] = $getValid((string)$k, $v);
58 58
                     }
59 59
                     break;
60 60
                 case 'string':
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $list = [];
86 86
         foreach ($attributes as $key => $value) {
87 87
             if (is_bool($value)) {
88
-                if ((bool) $value) {
88
+                if ((bool)$value) {
89 89
                     $list[] = $key;
90 90
                 }
91 91
             } else if (empty($value) && !is_int($value)) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         extract($vars);
107 107
         ob_start();
108 108
         require $template;
109
-        return (string) ob_get_clean();
109
+        return (string)ob_get_clean();
110 110
     }
111 111
 
112 112
     protected static function paging(&$v)
@@ -121,13 +121,12 @@  discard block
 block discarded – undo
121 121
 
122 122
             $limit = 10;
123 123
 
124
-            $v['start'] = $v['page'] > ($limit / 2) ?
125
-                    ($v['page'] - $limit / 2) :
126
-                    1;
124
+            $v['start'] = $v['page'] > ($limit/2) ?
125
+                    ($v['page'] - $limit/2) : 1;
127 126
 
128
-            if ($v['page'] > ($v['pages'] - ($limit / 2))) {
127
+            if ($v['page'] > ($v['pages'] - ($limit/2))) {
129 128
                 $v['final'] = $v['pages'];
130
-            } else if ($v['page'] > ($limit / 2)) {
129
+            } else if ($v['page'] > ($limit/2)) {
131 130
                 $v['final'] = $v['start'] + $limit;
132 131
             } else {
133 132
                 $v['final'] = $limit;
@@ -149,9 +148,9 @@  discard block
 block discarded – undo
149 148
         }
150 149
         $jump2show = function($m) use ($direction) {
151 150
             if ($m >= 1000000) {
152
-                return ($direction . ($m / 1000000) . "M");
151
+                return ($direction . ($m/1000000) . "M");
153 152
             } else if ($m >= 1000) {
154
-                return ($direction . ($m / 1000) . "K");
153
+                return ($direction . ($m/1000) . "K");
155 154
             } else {
156 155
                 return ($direction . $m);
157 156
             }
@@ -168,7 +167,7 @@  discard block
 block discarded – undo
168 167
             $html = $direction === '-' ? $add . $html : $html . $add;
169 168
         }
170 169
 
171
-        return $jump_exists ? self::pagingJumps($html, ($m * 10)) : $html;
170
+        return $jump_exists ? self::pagingJumps($html, ($m*10)) : $html;
172 171
     }
173 172
 
174 173
     protected static function filterValues(&$f, &$opts = [])
Please login to merge, or discard this patch.