Passed
Push — dev ( 2706b4...b82d65 )
by Plamen
02:16
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
         return self::attributes($attr);
61 59
     }
@@ -83,10 +81,9 @@  discard block
 block discarded – undo
83 81
     private static function thAttributes($col, $arg, &$sort, &$del)
84 82
     {
85 83
         if (isset($arg['width'])) { // Width attribute -> style
86
-            $width = 'width:'.$arg['width'].';';
84
+            $width = 'width:' . $arg['width'] . ';';
87 85
             $arg['style'] = isset($arg['style']) ?
88
-                $width.$arg['style'] :
89
-                $width;
86
+                $width . $arg['style'] : $width;
90 87
         }
91 88
 
92 89
         if (($del = isset($arg['type']) && $arg['type'] == 'delete')) {
@@ -100,23 +97,22 @@  discard block
 block discarded – undo
100 97
 
101 98
     private static function thTag($index, $attr, $sort, $del, $lbl)
102 99
     {
103
-        $tag = '<th'.self::attributes($attr).'>';
100
+        $tag = '<th' . self::attributes($attr) . '>';
104 101
         if ($sort) {
105
-            $tag .= '<a onclick="table.Sort('.$index.',this);">';
102
+            $tag .= '<a onclick="table.Sort(' . $index . ',this);">';
106 103
         }
107 104
         if (!$del) {
108 105
             if ($sort == self::$t['order']['col']) {
109 106
                 $span = self::$t['order']['dir'] === 'desc' ?
110
-                    self::config('UTF8_DESC_SYMBOL') :
111
-                    self::config('UTF8_ASC_SYMBOL');
107
+                    self::config('UTF8_DESC_SYMBOL') : self::config('UTF8_ASC_SYMBOL');
112 108
             } else {
113 109
                 $span = '';
114 110
             }
115
-            $tag .= '<span>'.$span.'</span>'.$lbl;
111
+            $tag .= '<span>' . $span . '</span>' . $lbl;
116 112
         } else {
117
-            $tag .= '<input id="'.self::$t['items'].'CheckDeleteAll"'.
118
-                ' onclick=\"checkAllDeleteCheckboxes(this,'.
119
-                ' \''.self::$t['items'].'\')" type="checkbox"/>';
113
+            $tag .= '<input id="' . self::$t['items'] . 'CheckDeleteAll"' .
114
+                ' onclick=\"checkAllDeleteCheckboxes(this,' .
115
+                ' \'' . self::$t['items'] . '\')" type="checkbox"/>';
120 116
         }
121 117
         if ($sort) {
122 118
             $tag .= '</a>';
Please login to merge, or discard this patch.