@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | switch (gettype($c)) { |
| 63 | 63 | case 'array'; |
| 64 | 64 | foreach ($c as $k => $v) { |
| 65 | - self::$config[$k] = $getValid((string) $k, $v); |
|
| 65 | + self::$config[$k] = $getValid((string)$k, $v); |
|
| 66 | 66 | } |
| 67 | 67 | break; |
| 68 | 68 | case 'string': |
@@ -86,8 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | //Condition: '' | '(HAVING|WHERE|AND) ' . $cond |
| 88 | 88 | $c = !empty($cond) && !strpos($q, ($cl = !$h ? 'WHERE' : 'HAVING')) ? |
| 89 | - (' ' . (!strpos($q, $cl) ? $cl : ' AND ') . ' ' . $cond ) : |
|
| 90 | - ''; |
|
| 89 | + (' ' . (!strpos($q, $cl) ? $cl : ' AND ') . ' ' . $cond) : ''; |
|
| 91 | 90 | //Order: '' | 'ORDER BY ' . array_keys($order)[0] . ' ' . $order[0] |
| 92 | 91 | $o = !empty($order) ? |
| 93 | 92 | ' ORDER BY ' . implode(', ', |
@@ -98,8 +97,7 @@ discard block |
||
| 98 | 97 | ''; |
| 99 | 98 | //Limit: '' | ' LIMIT ' . '(20, 40|20)' |
| 100 | 99 | $l = !empty($limit) ? |
| 101 | - (' LIMIT ' . (is_array($limit) ? implode(', ', $limit) : $limit)) : |
|
| 102 | - ''; |
|
| 100 | + (' LIMIT ' . (is_array($limit) ? implode(', ', $limit) : $limit)) : ''; |
|
| 103 | 101 | |
| 104 | 102 | return $q . $c . $o . $l; |
| 105 | 103 | } |
@@ -122,7 +120,7 @@ discard block |
||
| 122 | 120 | $list = []; |
| 123 | 121 | foreach ($attributes as $key => $value) { |
| 124 | 122 | if (is_bool($value)) { |
| 125 | - if ((bool) $value) { |
|
| 123 | + if ((bool)$value) { |
|
| 126 | 124 | $list[] = $key; |
| 127 | 125 | } |
| 128 | 126 | } else if (empty($value) && !is_int($value)) { |
@@ -143,7 +141,7 @@ discard block |
||
| 143 | 141 | extract($vars); |
| 144 | 142 | ob_start(); |
| 145 | 143 | require $template; |
| 146 | - return (string) ob_get_clean(); |
|
| 144 | + return (string)ob_get_clean(); |
|
| 147 | 145 | } |
| 148 | 146 | |
| 149 | 147 | /**Makes code radey for the next table |
@@ -46,8 +46,7 @@ discard block |
||
| 46 | 46 | private static function tagAttributes($tag, $items) |
| 47 | 47 | { |
| 48 | 48 | $attr = $tag === 'div' ? |
| 49 | - ['id' => $items . '-list', 'class' => 'table'] : |
|
| 50 | - ['id' => $items . '-table', 'data-table' => 'js']; |
|
| 49 | + ['id' => $items . '-list', 'class' => 'table'] : ['id' => $items . '-table', 'data-table' => 'js']; |
|
| 51 | 50 | if (array_key_exists($tag, self::$attributes)) { |
| 52 | 51 | $attr += self::$attributes[$tag]; |
| 53 | 52 | } |
@@ -82,8 +81,7 @@ discard block |
||
| 82 | 81 | if (isset($arg['width'])) { // Width attribute -> style |
| 83 | 82 | $width = 'width:' . $arg['width'] . ';'; |
| 84 | 83 | $arg['style'] = isset($arg['style']) ? |
| 85 | - $width . $arg['style'] : |
|
| 86 | - $width; |
|
| 84 | + $width . $arg['style'] : $width; |
|
| 87 | 85 | } |
| 88 | 86 | |
| 89 | 87 | if (($del = isset($arg['type']) && $arg['type'] == 'delete')) { |
@@ -92,7 +90,7 @@ discard block |
||
| 92 | 90 | $sort = isset($arg['sort']) ? $arg['sort'] : $col; |
| 93 | 91 | } |
| 94 | 92 | |
| 95 | - return array_diff_key((array) $arg, ['sort', 'type', 'width']); |
|
| 93 | + return array_diff_key((array)$arg, ['sort', 'type', 'width']); |
|
| 96 | 94 | } |
| 97 | 95 | |
| 98 | 96 | private static function th($i, $attr, $sort, $del, $lbl) |
@@ -104,8 +102,7 @@ discard block |
||
| 104 | 102 | if (!$del) { |
| 105 | 103 | if ($sort == self::$t['order']['col']) { |
| 106 | 104 | $span = self::$t['order']['dir'] === 'desc' ? |
| 107 | - self::config('UTF8_DESC_SYMBOL') : |
|
| 108 | - self::config('UTF8_ASC_SYMBOL'); |
|
| 105 | + self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL'); |
|
| 109 | 106 | } else { |
| 110 | 107 | $span = ""; |
| 111 | 108 | } |
@@ -48,8 +48,7 @@ discard block |
||
| 48 | 48 | $rows = [$header]; |
| 49 | 49 | |
| 50 | 50 | $data = self::$exportDataAsDisplayed ? |
| 51 | - self::$data : |
|
| 52 | - self::select(self::$t['q']); |
|
| 51 | + self::$data : self::select(self::$t['q']); |
|
| 53 | 52 | |
| 54 | 53 | if (count($data) > 0) { |
| 55 | 54 | foreach ($data as $row) { |
@@ -95,8 +94,7 @@ discard block |
||
| 95 | 94 | if (($output = fopen('php://output', 'w'))) { |
| 96 | 95 | foreach ($eData as $v) { |
| 97 | 96 | self::$export === 'CSV' ? |
| 98 | - fputcsv($output, $v) : |
|
| 99 | - fputs($output, implode("\t", array_map($escape, $v)) . "\r\n"); |
|
| 97 | + fputcsv($output, $v) : fputs($output, implode("\t", array_map($escape, $v)) . "\r\n"); |
|
| 100 | 98 | } |
| 101 | 99 | fclose($output); |
| 102 | 100 | } |