Passed
Push — dev ( 025c9d...b5d42a )
by Plamen
02:00
created
Tbody.php 1 patch
Spacing   +11 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
             if (isset($r[0][1], $r[0][1]['class']) &&
32 32
                 $r[0][1]['class'] === 'no-results'
33 33
             ) {
34
-                $trs .= '<tr><td'.self::attributes($r[0][1]).'>'
35
-                    .$r[0][0].'</td></tr>';
34
+                $trs .= '<tr><td' . self::attributes($r[0][1]) . '>'
35
+                    .$r[0][0] . '</td></tr>';
36 36
             } else {
37
-                $trs .= '<tr><td>'.implode('</td><td>', $r)
37
+                $trs .= '<tr><td>' . implode('</td><td>', $r)
38 38
                     .'</td></tr>';
39 39
             }
40 40
         }
@@ -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
             }
@@ -87,21 +85,20 @@  discard block
 block discarded – undo
87 85
         switch (self::$export) {
88 86
             case 'Excel':
89 87
             case 'CSV':
90
-                $escape = function ($value) {
88
+                $escape = function($value) {
91 89
                     return str_replace("\t", '&#9;', $value);
92 90
                 };
93 91
 
94 92
                 $output = fopen('php://output', 'w');
95 93
                 if (substr($filename, -2) !== '()') { //4 testing
96 94
                     header('Content-Type:application/csv');
97
-                    header('Content-Disposition:attachment; filename='.
98
-                            $filename.'.csv');
95
+                    header('Content-Disposition:attachment; filename=' .
96
+                            $filename . '.csv');
99 97
                 }
100 98
                 foreach ($eData as $v) {
101 99
                     self::$export === 'CSV' ?
102
-                            fputcsv($output, $v) :
103
-                            fwrite($output,
104
-                                implode("\t", array_map($escape, $v))."\r\n");
100
+                            fputcsv($output, $v) : fwrite($output,
101
+                                implode("\t", array_map($escape, $v)) . "\r\n");
105 102
                 }
106 103
 
107 104
                 return fclose($output);
@@ -114,7 +111,7 @@  discard block
 block discarded – undo
114 111
         $fnReplace[':app'] = self::config('APP');
115 112
         $fnReplace[':items'] = self::$t['items'];
116 113
         $format = str_replace(':', '.', '%d.%m.%Y  %H:%i:%s');
117
-        $timeQuery = 'SELECT DATE_FORMAT(Now(), "'.$format.'") AS `now`;';
114
+        $timeQuery = 'SELECT DATE_FORMAT(Now(), "' . $format . '") AS `now`;';
118 115
         $fnReplace[':datetime'] = self::select($timeQuery);
119 116
 
120 117
         return strtr((string) self::config('EXPORT_FILE_NAME'), $fnReplace);
Please login to merge, or discard this patch.