Passed
Push — dev ( 9db0e4...2706b4 )
by Plamen
02:31
created
TraitQuery.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
         array $order = [],
18 18
         $limit = 0,
19 19
         $useHaving = false
20
-    )
21
-    {
20
+    ) {
22 21
         //Condition: '' | ' (HAVING|WHERE|AND) ' . $cond
23 22
         self::queryConditions($query, $cond, $useHaving);
24 23
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
         if (!empty($cond)) {
37 37
             $clause = !$useHaving ? 'WHERE' : 'HAVING';
38 38
             $clue = !strpos($query, $clause) ? $clause : 'AND';
39
-            $query .= (' '.$clue.' '.$cond);
39
+            $query .= (' ' . $clue . ' ' . $cond);
40 40
         }
41 41
     }
42 42
 
43 43
     private static function queryOrder(&$query, $order)
44 44
     {
45 45
         if (!empty($order)) {
46
-            $arr = array_map(function (&$value, $key) {
47
-                return $key.' '.strtoupper($value);
46
+            $arr = array_map(function(&$value, $key) {
47
+                return $key . ' ' . strtoupper($value);
48 48
             }, $order, array_keys($order));
49
-            $query .= (' ORDER BY '.implode(', ', $arr));
49
+            $query .= (' ORDER BY ' . implode(', ', $arr));
50 50
         }
51 51
     }
52 52
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         if (!empty($limit)) {
56 56
             $value = (is_array($limit) ? implode(', ', $limit) : $limit);
57
-            $query .= (' LIMIT '.$value);
57
+            $query .= (' LIMIT ' . $value);
58 58
         }
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
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.
TraitRequest.php 1 patch
Spacing   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
             } else {
30 30
                 $filterBy = self::$cols[$filterBy][1];
31 31
             }
32
-            $filterBy = 'CONCAT(" ",'.$filterBy.', " ")';
32
+            $filterBy = 'CONCAT(" ",' . $filterBy . ', " ")';
33 33
             if (self::config('FILTER_CASE_SENSITIVE') !== true) {
34
-                $filterBy .= ' COLLATE '.self::config('DB_COLLATION_CI');
34
+                $filterBy .= ' COLLATE ' . self::config('DB_COLLATION_CI');
35 35
             }
36
-            $filter = $filterBy.' LIKE '.'"%'.$filter.'%"';
36
+            $filter = $filterBy . ' LIKE ' . '"%' . $filter . '%"';
37 37
         }
38 38
         return $filter;
39 39
     }
@@ -45,17 +45,16 @@  discard block
 block discarded – undo
45 45
             if (isset($v[2]['sort']) && $v[2]['sort'] === false) {
46 46
                 continue;
47 47
             }
48
-            $all[] = 'IFNULL('.$v[1].', "")';
48
+            $all[] = 'IFNULL(' . $v[1] . ', "")';
49 49
         }
50
-        return 'CONCAT('.implode(',', $all).')';
50
+        return 'CONCAT(' . implode(',', $all) . ')';
51 51
     }
52 52
 
53 53
     private static function orderCol()
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 setExport()
@@ -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.
TraitPaging.php 1 patch
Spacing   +11 added lines, -13 removed lines patch added patch discarded remove patch
@@ -15,13 +15,12 @@  discard block
 block discarded – undo
15 15
 
16 16
             $limit = 10;
17 17
 
18
-            $vars['start'] = $vars['page'] > ($limit / 2) ?
19
-                ($vars['page'] - $limit / 2) :
20
-                1;
18
+            $vars['start'] = $vars['page'] > ($limit/2) ?
19
+                ($vars['page'] - $limit/2) : 1;
21 20
 
22
-            if ($vars['page'] > ($vars['pages'] - ($limit / 2))) {
21
+            if ($vars['page'] > ($vars['pages'] - ($limit/2))) {
23 22
                 $vars['final'] = $vars['pages'];
24
-            } elseif ($vars['page'] > ($limit / 2)) {
23
+            } elseif ($vars['page'] > ($limit/2)) {
25 24
                 $vars['final'] = $vars['start'] + $limit;
26 25
             } else {
27 26
                 $vars['final'] = $limit;
@@ -43,15 +42,14 @@  discard block
 block discarded – undo
43 42
         }
44 43
 
45 44
         $jump = self::jump($multiplier, $direction);
46
-        $add = '<li class="jump"><a>'.$jump.'</a></li>';
45
+        $add = '<li class="jump"><a>' . $jump . '</a></li>';
47 46
 
48 47
         $jumpExists = $direction === '-' ?
49
-            (self::$t['page'] - $multiplier) > 0 :
50
-            (self::$t['page'] + $multiplier) <= self::$t['pages'];
48
+            (self::$t['page'] - $multiplier) > 0 : (self::$t['page'] + $multiplier) <= self::$t['pages'];
51 49
 
52 50
         if ($jumpExists) {
53
-            $html = $direction === '-' ? $add.$html : $html.$add;
54
-            return self::jumps($html, ($multiplier * 10));
51
+            $html = $direction === '-' ? $add . $html : $html . $add;
52
+            return self::jumps($html, ($multiplier*10));
55 53
         }
56 54
 
57 55
         return $html;
@@ -60,11 +58,11 @@  discard block
 block discarded – undo
60 58
     private static function jump($multiplier, $direction)
61 59
     {
62 60
         if ($multiplier >= 1000000) {
63
-            return ($direction.($multiplier / 1000000)."M");
61
+            return ($direction . ($multiplier/1000000) . "M");
64 62
         } elseif ($multiplier >= 1000) {
65
-            return ($direction.($multiplier / 1000)."K");
63
+            return ($direction . ($multiplier/1000) . "K");
66 64
         } else {
67
-            return ($direction.$multiplier);
65
+            return ($direction . $multiplier);
68 66
         }
69 67
     }
70 68
 }
Please login to merge, or discard this patch.
TraitConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                     throw new Exception("Invalid value type.");
38 38
             }
39 39
         } catch (Exception $e) {
40
-            self::error('ERROR: '.$e->getMessage());
40
+            self::error('ERROR: ' . $e->getMessage());
41 41
         }
42 42
     }
43 43
 
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
             self::$errors[] = $message;
48 48
         } else {
49 49
             return empty(self::$errors) ? null :
50
-                '<p class="tbl-err">'.implode('</br>', self::$errors).'</p>';
50
+                '<p class="tbl-err">' . implode('</br>', self::$errors) . '</p>';
51 51
         }
52 52
     }
53 53
 
54 54
     private static function valid($key, $val = null)
55 55
     {
56 56
         if (!array_key_exists($key, self::$config)) {
57
-            throw new Exception('Request to undefined value: '.$key);
57
+            throw new Exception('Request to undefined value: ' . $key);
58 58
         }
59 59
 
60 60
         if ($val !== null) {
Please login to merge, or discard this patch.
Table.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
     public static function prepare($setOrCheck = false)
38 38
     {
39 39
         //@see  http://php.net/manual/es/function.filter-input.php#77307
40
-        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?:
41
-            filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
40
+        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?: filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
42 41
 
43 42
         $extension = pathinfo(strtok($uri, '?'), PATHINFO_EXTENSION);
44 43
 
@@ -70,9 +69,9 @@  discard block
 block discarded – undo
70 69
         self::$t['order']['col'] = $orderBy;
71 70
         $dir = strtolower($orderDir);
72 71
         self::$t['order']['dir'] = in_array($dir, ['asc', 'desc']) ?
73
-            $dir : self::error('Invalid orderDir (Asc/Desc): '.$orderDir);
72
+            $dir : self::error('Invalid orderDir (Asc/Desc): ' . $orderDir);
74 73
         self::$t['paging'] = ($num = abs($paging)) >= 10 ?
75
-            $num : self::error('Invalid paging (<10): '.$paging);
74
+            $num : self::error('Invalid paging (<10): ' . $paging);
76 75
     }
77 76
 
78 77
     /**
@@ -89,7 +88,7 @@  discard block
 block discarded – undo
89 88
         self::$t = self::request(self::$export);
90 89
 
91 90
         $order = [self::$t['order']['col'] => self::$t['order']['dir']];
92
-        $offset = (self::$t['page'] - 1) * self::$t['paging'];
91
+        $offset = (self::$t['page'] - 1)*self::$t['paging'];
93 92
         $limit = [$offset, self::$t['paging']];
94 93
         self::$t['q'] = self::query($query, self::$t['filter'], $order, $limit, true);
95 94
 
@@ -102,7 +101,7 @@  discard block
 block discarded – undo
102 101
         try {
103 102
             self::$data = self::select($q);
104 103
         } catch (Exception $e) {
105
-            self::error('ERROR: '.$q.'<br />'.$e->getMessage());
104
+            self::error('ERROR: ' . $q . '<br />' . $e->getMessage());
106 105
         }
107 106
     }
108 107
 
@@ -114,7 +113,7 @@  discard block
 block discarded – undo
114 113
             echo parent::load();
115 114
         } else {
116 115
             $tableId = filter_input(INPUT_GET, 'table-id') ?: null;
117
-            if ($tableId === self::$t['items'].'-table') {
116
+            if ($tableId === self::$t['items'] . '-table') {
118 117
                 ob_get_clean();
119 118
                 ob_start('ob_gzhandler');
120 119
                 if (!self::$export) {
Please login to merge, or discard this patch.
TraitHelper.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 
18 18
     public static function assets($path = "/public/table")
19 19
     {
20
-        return "<script src=\"{$path}/table_helper.js\" defer></script>\n\t".
21
-            "<script src=\"{$path}/table.js\" defer></script>\n\t".
20
+        return "<script src=\"{$path}/table_helper.js\" defer></script>\n\t" .
21
+            "<script src=\"{$path}/table.js\" defer></script>\n\t" .
22 22
             "<link href=\"{$path}/table.css\" rel=\"stylesheet\">\n";
23 23
     }
24 24
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             if ($value === true || (empty($value) && $value != 0)) {
33 33
                 $list[] = $key;
34 34
             } else {
35
-                $list[] = $key.'="'.$value.'"';
35
+                $list[] = $key . '="' . $value . '"';
36 36
             }
37 37
         }
38 38
         return rtrim(implode(' ', $list));
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             self::$cols = [];
60 60
             self::$t['rows'] = null;
61 61
         } else {
62
-            echo 'Existing table-id used in table::create(): '.$items;
62
+            echo 'Existing table-id used in table::create(): ' . $items;
63 63
         }
64 64
     }
65 65
     
@@ -71,23 +71,22 @@  discard block
 block discarded – undo
71 71
         try {
72 72
             $p = explode('.', $property);
73 73
             $name = array_shift($p);
74
-            if(property_exists(__CLASS__, $name)){
75
-                switch(sizeof($p)){
74
+            if (property_exists(__CLASS__, $name)) {
75
+                switch (sizeof($p)) {
76 76
                     case 3: return static::$$name[$p[0]][$p[1]][$p[2]] === $value;
77 77
                     case 2: return static::$$name[$p[0]][$p[1]] === $value;
78 78
                     case 1: return $p[0] === '∞' ? //request is to the last one
79
-                        static::$$name[(sizeof(static::$$name)-1)] === $value : 
80
-                        static::$$name[$p[0]] === $value;
79
+                        static::$$name[(sizeof(static::$$name) - 1)] === $value : static::$$name[$p[0]] === $value;
81 80
                     case 0: return static::$$name === $value;
82 81
                     default: 
83 82
                         $oops = implode($p);
84 83
                         throw new Exception('Missing value (' . $oops . ').');
85 84
                 }
86 85
             } else {
87
-                throw new Exception('Undefined property ('.$name.').');
86
+                throw new Exception('Undefined property (' . $name . ').');
88 87
             }
89 88
         } catch (Exception $e) {
90
-            echo 'Caught exception: ',  $e->getMessage(), "\n";
89
+            echo 'Caught exception: ', $e->getMessage(), "\n";
91 90
         }
92 91
         return false;
93 92
     }
Please login to merge, or discard this patch.
Tfoot.php 1 patch
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
             $vars = [];
18 18
             self::showingMessageVars($vars);
19 19
             if (self::$exportActive === true) {
20
-                $url = strtok(self::$t['slug'], '?&').'.json?table='.
21
-                    self::$t['items'].'&export=';
20
+                $url = strtok(self::$t['slug'], '?&') . '.json?table=' .
21
+                    self::$t['items'] . '&export=';
22 22
                 $vars['export']['url'] = $url;
23 23
                 $vars['export']['types'] = self::config('SAVES');
24 24
             }
@@ -38,15 +38,14 @@  discard block
 block discarded – undo
38 38
             //Skips total count query
39 39
             self::$t['rows'] = count(self::$data);
40 40
         } else {
41
-            $query = 'SELECT COUNT(*) FROM ('.self::$t['qAll'].') AS dt';
41
+            $query = 'SELECT COUNT(*) FROM (' . self::$t['qAll'] . ') AS dt';
42 42
             self::$t['rows'] = self::select($query);
43 43
         }
44
-        self::$t['pages'] = ceil(self::$t['rows'] / self::$t['paging']);
44
+        self::$t['pages'] = ceil(self::$t['rows']/self::$t['paging']);
45 45
 
46
-        $vars['from'] = ($pageNo - 1) * self::$t['paging'] + 1;
47
-        $vars['upto'] = ($pageNo * self::$t['paging'] < self::$t['rows']) ?
48
-            $pageNo * self::$t['paging'] :
49
-            self::$t['rows'];
46
+        $vars['from'] = ($pageNo - 1)*self::$t['paging'] + 1;
47
+        $vars['upto'] = ($pageNo*self::$t['paging'] < self::$t['rows']) ?
48
+            $pageNo*self::$t['paging'] : self::$t['rows'];
50 49
 
51 50
         $vars['total'] = self::$t['rows'];
52 51
         $vars['items'] = self::$t['items'];
@@ -57,11 +56,11 @@  discard block
 block discarded – undo
57 56
         $trs = '';
58 57
         if (self::$t['rows'] > 0) {
59 58
             $ftr = self::jsonTfoot()[0][0];
60
-            $trs .= '<tr><td'.self::attributes($ftr[1]).'>'
61
-                .$ftr[0].'</td></tr>';
59
+            $trs .= '<tr><td' . self::attributes($ftr[1]) . '>'
60
+                .$ftr[0] . '</td></tr>';
62 61
         } elseif (count(self::$errors) > 0) {
63
-            $trs .= '<tr><td colspan="'.count(self::$cols).'">'.
64
-                self::error().'</td></tr>';
62
+            $trs .= '<tr><td colspan="' . count(self::$cols) . '">' .
63
+                self::error() . '</td></tr>';
65 64
         }
66 65
 
67 66
         return $trs;
@@ -74,8 +73,7 @@  discard block
 block discarded – undo
74 73
             $res = $select($expression, $bindings);
75 74
             //if result is single cell value ($res[0]->value), return the value
76 75
             return (count($res) === 1 && count((array) $res[0]) === 1) ?
77
-                reset($res[0]) :
78
-                $res;
76
+                reset($res[0]) : $res;
79 77
         } else {
80 78
             throw new Exception('ERROR: table::$select is not a closure. ');
81 79
         }
Please login to merge, or discard this patch.
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,19 +85,18 @@  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
                 header('Content-Type:application/csv');
94
-                header('Content-Disposition:attachment; filename='.
95
-                    $filename.'.csv');
92
+                header('Content-Disposition:attachment; filename=' .
93
+                    $filename . '.csv');
96 94
 
97 95
                 if (($output = fopen('php://output', 'w'))) {
98 96
                     foreach ($eData as $v) {
99 97
                         self::$export === 'CSV' ?
100
-                                fputcsv($output, $v) :
101
-                                fwrite($output,
102
-                                    implode("\t", array_map($escape, $v))."\r\n");
98
+                                fputcsv($output, $v) : fwrite($output,
99
+                                    implode("\t", array_map($escape, $v)) . "\r\n");
103 100
                     }
104 101
                     fclose($output);
105 102
                 }
@@ -113,7 +110,7 @@  discard block
 block discarded – undo
113 110
         $fnReplace[':app'] = self::config('APP');
114 111
         $fnReplace[':items'] = self::$t['items'];
115 112
         $format = str_replace(':', '.', '%d.%m.%Y  %H:%i:%s');
116
-        $timeQuery = 'SELECT DATE_FORMAT(Now(), "'.$format.'") AS `now`;';
113
+        $timeQuery = 'SELECT DATE_FORMAT(Now(), "' . $format . '") AS `now`;';
117 114
         $fnReplace[':datetime'] = self::select($timeQuery);
118 115
 
119 116
         return strtr((string) self::config('EXPORT_FILE_NAME'), $fnReplace);
Please login to merge, or discard this patch.