@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if ($v !== null) { |
| 43 | - if(empty($v) || gettype($v) !== gettype(self::$config[$k])) { |
|
| 43 | + if (empty($v) || gettype($v) !== gettype(self::$config[$k])) { |
|
| 44 | 44 | throw new Exception("Setting invalid value: $v (:$k)"); |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | switch (gettype($c)) { |
| 53 | 53 | case 'array'; |
| 54 | 54 | foreach ($c as $k => $v) { |
| 55 | - self::$config[$k] = $getValid((string) $k, $v); |
|
| 55 | + self::$config[$k] = $getValid((string)$k, $v); |
|
| 56 | 56 | } |
| 57 | 57 | break; |
| 58 | 58 | case 'string': |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $list = []; |
| 74 | 74 | foreach ($attributes as $key => $value) { |
| 75 | 75 | if (is_bool($value)) { |
| 76 | - if ((bool) $value) { |
|
| 76 | + if ((bool)$value) { |
|
| 77 | 77 | $list[] = $key; |
| 78 | 78 | } |
| 79 | 79 | } else if (empty($value) && !is_int($value)) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | extract($vars); |
| 95 | 95 | ob_start(); |
| 96 | 96 | require $template; |
| 97 | - return (string) ob_get_clean(); |
|
| 97 | + return (string)ob_get_clean(); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | protected static function paging(&$v) |
@@ -109,13 +109,12 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $limit = 10; |
| 111 | 111 | |
| 112 | - $v['start'] = $v['page'] > ($limit / 2) ? |
|
| 113 | - ($v['page'] - $limit / 2) : |
|
| 114 | - 1; |
|
| 112 | + $v['start'] = $v['page'] > ($limit/2) ? |
|
| 113 | + ($v['page'] - $limit/2) : 1; |
|
| 115 | 114 | |
| 116 | - if ($v['page'] > ($v['pages'] - ($limit / 2))) { |
|
| 115 | + if ($v['page'] > ($v['pages'] - ($limit/2))) { |
|
| 117 | 116 | $v['final'] = $v['pages']; |
| 118 | - } else if ($v['page'] > ($limit / 2)) { |
|
| 117 | + } else if ($v['page'] > ($limit/2)) { |
|
| 119 | 118 | $v['final'] = $v['start'] + $limit; |
| 120 | 119 | } else { |
| 121 | 120 | $v['final'] = $limit; |
@@ -137,9 +136,9 @@ discard block |
||
| 137 | 136 | } |
| 138 | 137 | $jump2show = function($m) use ($direction) { |
| 139 | 138 | if ($m >= 1000000) { |
| 140 | - return ($direction . ($m / 1000000) . "M"); |
|
| 139 | + return ($direction . ($m/1000000) . "M"); |
|
| 141 | 140 | } else if ($m >= 1000) { |
| 142 | - return ($direction . ($m / 1000) . "K"); |
|
| 141 | + return ($direction . ($m/1000) . "K"); |
|
| 143 | 142 | } else { |
| 144 | 143 | return ($direction . $m); |
| 145 | 144 | } |
@@ -156,7 +155,7 @@ discard block |
||
| 156 | 155 | $html = $direction === '-' ? $add . $html : $html . $add; |
| 157 | 156 | } |
| 158 | 157 | |
| 159 | - return $jump_exists ? self::pagingJumps($html, ($m * 10)) : $html; |
|
| 158 | + return $jump_exists ? self::pagingJumps($html, ($m*10)) : $html; |
|
| 160 | 159 | } |
| 161 | 160 | |
| 162 | 161 | protected static function filterValues(&$f, &$opts = []) |
@@ -206,8 +205,7 @@ discard block |
||
| 206 | 205 | { |
| 207 | 206 | if (($col = filter_input(INPUT_GET, 'col', FILTER_VALIDATE_INT))) { |
| 208 | 207 | return isset(self::$cols[$col][2]['sort']) ? |
| 209 | - self::$cols[$col][2]['sort'] : |
|
| 210 | - self::$cols[$col][1]; |
|
| 208 | + self::$cols[$col][2]['sort'] : self::$cols[$col][1]; |
|
| 211 | 209 | } |
| 212 | 210 | return self::$t['order']['col']; |
| 213 | 211 | } |
@@ -216,8 +214,7 @@ discard block |
||
| 216 | 214 | { |
| 217 | 215 | $reset = filter_has_var(INPUT_GET, 'col') ? 'asc' : null; |
| 218 | 216 | return in_array(filter_input(INPUT_GET, 'ord'), ['asc', 'desc']) ? |
| 219 | - filter_input(INPUT_GET, 'ord') : |
|
| 220 | - ($reset ?: self::$t['order']['dir']); |
|
| 217 | + filter_input(INPUT_GET, 'ord') : ($reset ?: self::$t['order']['dir']); |
|
| 221 | 218 | } |
| 222 | 219 | |
| 223 | 220 | protected static function requestExport() |
@@ -229,7 +226,6 @@ discard block |
||
| 229 | 226 | protected static function requestPage() |
| 230 | 227 | { |
| 231 | 228 | return filter_has_var(INPUT_GET, 'pg') && self::$export == false ? |
| 232 | - (int) filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : |
|
| 233 | - self::$t['page']; |
|
| 229 | + (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : self::$t['page']; |
|
| 234 | 230 | } |
| 235 | 231 | } |