Passed
Push — master ( 286eca...ea0496 )
by Plamen
01:27
created
thead.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
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
             'data-sort-a' => self::config('UTF8_ASC_SYMBOL'),
52 51
             'data-sort-d' => self::config('UTF8_DESC_SYMBOL')];
53 52
         if (array_key_exists($tag, self::$attributes)) {
@@ -84,8 +83,7 @@  discard block
 block discarded – undo
84 83
         if (isset($arg['width'])) { // Width attribute -> style
85 84
             $width = 'width:' . $arg['width'] . ';';
86 85
             $arg['style'] = isset($arg['style']) ?
87
-                    $width . $arg['style'] :
88
-                    $width;
86
+                    $width . $arg['style'] : $width;
89 87
         }
90 88
 
91 89
         if (($del = isset($arg['type']) && $arg['type'] == 'delete')) {
@@ -106,8 +104,7 @@  discard block
 block discarded – undo
106 104
         if (!$del) {
107 105
             if ($sort == self::$t['order']['col']) {
108 106
                 $span = self::$t['order']['dir'] === 'desc' ?
109
-                        self::config('UTF8_DESC_SYMBOL') :
110
-                        self::config('UTF8_ASC_SYMBOL');
107
+                        self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL');
111 108
             } else {
112 109
                 $span = "";
113 110
             }
Please login to merge, or discard this patch.
tbody.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,16 +49,14 @@  discard block
 block discarded – undo
49 49
         $rows = [$header];
50 50
 
51 51
         $data = self::$exportDataAsDisplayed ?
52
-                self::$data :
53
-                self::select(self::$t['q']);
52
+                self::$data : self::select(self::$t['q']);
54 53
 
55 54
         if (count($data) > 0) {
56 55
             foreach ($data as $row) {
57 56
                 $cells = [];
58 57
                 foreach ($columns as $column) {
59 58
                     $cells[] = is_array($row[$column]) ?
60
-                            $row[$column][0] :
61
-                            $row[$column];
59
+                            $row[$column][0] : $row[$column];
62 60
                 }
63 61
                 $rows[] = $cells;
64 62
             }
@@ -96,8 +94,7 @@  discard block
 block discarded – undo
96 94
                 if (($output = fopen('php://output', 'w'))) {
97 95
                     foreach ($eData as $v) {
98 96
                         self::$export === 'CSV' ?
99
-                                        fputcsv($output, $v) :
100
-                                        fputs($output, implode("\t", array_map($escape, $v)) . "\r\n");
97
+                                        fputcsv($output, $v) : fputs($output, implode("\t", array_map($escape, $v)) . "\r\n");
101 98
                     }
102 99
                     fclose($output);
103 100
                 }
Please login to merge, or discard this patch.
table.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
     public static function prepare($setOrCheck = false)
27 27
     {
28 28
         //@see  http://php.net/manual/es/function.filter-input.php#77307
29
-        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?:
30
-                filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
29
+        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?: filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
31 30
 
32 31
         $extension = pathinfo(strtok($uri, '?'), PATHINFO_EXTENSION);
33 32
 
@@ -76,7 +75,7 @@  discard block
 block discarded – undo
76 75
         self::$t = self::request(self::$export);
77 76
 
78 77
         $order = [self::$t['order']['col'] => self::$t['order']['dir']];
79
-        $offset = (self::$t['page'] - 1) * self::$t['paging'];
78
+        $offset = (self::$t['page'] - 1)*self::$t['paging'];
80 79
         $limit = [$offset, self::$t['paging']];
81 80
         self::$t['q'] = self::q($q, self::$t['filter'], $order, $limit, true);
82 81
 
Please login to merge, or discard this patch.
trait_request.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         if (($col = filter_input(INPUT_GET, 'col', FILTER_VALIDATE_INT))) {
56 56
             return isset(self::$cols[$col][2]['sort']) ?
57
-                    self::$cols[$col][2]['sort'] :
58
-                    self::$cols[$col][1];
57
+                    self::$cols[$col][2]['sort'] : self::$cols[$col][1];
59 58
         }
60 59
         return self::$t['order']['col'];
61 60
     }
@@ -64,8 +63,7 @@  discard block
 block discarded – undo
64 63
     {
65 64
         $reset = filter_has_var(INPUT_GET, 'col') ? 'asc' : null;
66 65
         return in_array(filter_input(INPUT_GET, 'ord'), ['asc', 'desc']) ?
67
-                filter_input(INPUT_GET, 'ord') :
68
-                ($reset ?: self::$t['order']['dir']);
66
+                filter_input(INPUT_GET, 'ord') : ($reset ?: self::$t['order']['dir']);
69 67
     }
70 68
 
71 69
     private static function set_export()
@@ -77,7 +75,6 @@  discard block
 block discarded – undo
77 75
     private static function page()
78 76
     {
79 77
         return filter_has_var(INPUT_GET, 'pg') && self::$export == false ?
80
-                (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) :
81
-                self::$t['page'];
78
+                (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT) : self::$t['page'];
82 79
     }
83 80
 }
Please login to merge, or discard this patch.
tfoot.php 1 patch
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,12 +38,11 @@  discard block
 block discarded – undo
38 38
             $q = 'SELECT COUNT(*) FROM (' . self::$t['qAll'] . ') AS dt';
39 39
             self::$t['rows'] = self::select($q);
40 40
         }
41
-        self::$t['pages'] = ceil(self::$t['rows'] / self::$t['paging']);
41
+        self::$t['pages'] = ceil(self::$t['rows']/self::$t['paging']);
42 42
 
43
-        $v['from'] = ($pageNo - 1) * self::$t['paging'] + 1;
44
-        $v['upto'] = ($pageNo * self::$t['paging'] < self::$t['rows']) ?
45
-                $pageNo * self::$t['paging'] :
46
-                self::$t['rows'];
43
+        $v['from'] = ($pageNo - 1)*self::$t['paging'] + 1;
44
+        $v['upto'] = ($pageNo*self::$t['paging'] < self::$t['rows']) ?
45
+                $pageNo*self::$t['paging'] : self::$t['rows'];
47 46
 
48 47
         $v["total"] = self::$t['rows'];
49 48
         $v["items"] = self::$t['items'];
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
             $res = $select($expression, $bindings);
71 70
             //if result is single cell value ($res[0]->value), return the value
72 71
             return (count($res) === 1 && count((array)$res[0]) === 1) ?
73
-                    reset($res[0]) :
74
-                    $res;
72
+                    reset($res[0]) : $res;
75 73
         } else {
76 74
             throw new Exception('ERROR: table::$select is not a closure. ');
77 75
         }
Please login to merge, or discard this patch.