Passed
Push — dev ( b82d65...e388e4 )
by Plamen
03:27 queued 01:18
created
Thead.php 1 patch
Spacing   +12 added lines, -16 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     protected static function filterValues(&$filter, &$opts = [])
33 33
     {
34
-        $filter = filter_input(INPUT_GET, 'filter', FILTER_SANITIZE_STRING) ?:
35
-            null;
34
+        $filter = filter_input(INPUT_GET, 'filter', FILTER_SANITIZE_STRING) ?: null;
36 35
 
37 36
         $filterBy = filter_input(INPUT_GET, 'filter-by', FILTER_VALIDATE_INT);
38 37
         foreach (self::$cols as $key => $value) {
@@ -47,15 +46,14 @@  discard block
 block discarded – undo
47 46
     private static function tagAttributes($tag, $items)
48 47
     {
49 48
         $attr = $tag === 'div' ?
50
-            ['id' => $items.'-list', 'class' => 'table'] :
51
-            ['id'         => $items.'-table', 'data-table' => 'js',
49
+            ['id' => $items . '-list', 'class' => 'table'] : ['id'         => $items . '-table', 'data-table' => 'js',
52 50
             'data-sort-a' => self::config('UTF8_ASC_SYMBOL'),
53 51
             'data-sort-d' => self::config('UTF8_DESC_SYMBOL'), ];
54 52
         if (array_key_exists($tag, self::$attributes)) {
55 53
             $attr += self::$attributes[$tag];
56 54
         }
57 55
         if (isset(self::$attributes[$tag]['class'])) {
58
-            $attr['class'] .= ' '.self::$attributes[$tag]['class'];
56
+            $attr['class'] .= ' ' . self::$attributes[$tag]['class'];
59 57
         }
60 58
 
61 59
         return self::attributes($attr);
@@ -85,10 +83,9 @@  discard block
 block discarded – undo
85 83
     private static function thAttributes($col, $arg, &$sort, &$del)
86 84
     {
87 85
         if (isset($arg['width'])) { // Width attribute -> style
88
-            $width = 'width:'.$arg['width'].';';
86
+            $width = 'width:' . $arg['width'] . ';';
89 87
             $arg['style'] = isset($arg['style']) ?
90
-                $width.$arg['style'] :
91
-                $width;
88
+                $width . $arg['style'] : $width;
92 89
         }
93 90
 
94 91
         if (($del = isset($arg['type']) && $arg['type'] == 'delete')) {
@@ -102,23 +99,22 @@  discard block
 block discarded – undo
102 99
 
103 100
     private static function thTag($index, $attr, $sort, $del, $lbl)
104 101
     {
105
-        $tag = '<th'.self::attributes($attr).'>';
102
+        $tag = '<th' . self::attributes($attr) . '>';
106 103
         if ($sort) {
107
-            $tag .= '<a onclick="table.Sort('.$index.',this);">';
104
+            $tag .= '<a onclick="table.Sort(' . $index . ',this);">';
108 105
         }
109 106
         if (!$del) {
110 107
             if ($sort == self::$t['order']['col']) {
111 108
                 $span = self::$t['order']['dir'] === 'desc' ?
112
-                    self::config('UTF8_DESC_SYMBOL') :
113
-                    self::config('UTF8_ASC_SYMBOL');
109
+                    self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL');
114 110
             } else {
115 111
                 $span = '';
116 112
             }
117
-            $tag .= '<span>'.$span.'</span>'.$lbl;
113
+            $tag .= '<span>' . $span . '</span>' . $lbl;
118 114
         } else {
119
-            $tag .= '<input id="'.self::$t['items'].'CheckDeleteAll"'.
120
-                ' onclick=\"checkAllDeleteCheckboxes(this,'.
121
-                ' \''.self::$t['items'].'\')" type="checkbox"/>';
115
+            $tag .= '<input id="' . self::$t['items'] . 'CheckDeleteAll"' .
116
+                ' onclick=\"checkAllDeleteCheckboxes(this,' .
117
+                ' \'' . self::$t['items'] . '\')" type="checkbox"/>';
122 118
         }
123 119
         if ($sort) {
124 120
             $tag .= '</a>';
Please login to merge, or discard this patch.