Passed
Push — dev ( 5cccb4...439f82 )
by Plamen
02:04
created
Table.php 1 patch
Spacing   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
     public static function prepare($setOrCheck = false)
39 39
     {
40 40
         //@see  http://php.net/manual/es/function.filter-input.php#77307
41
-        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?:
42
-            filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
41
+        $uri = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL) ?: filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
43 42
 
44 43
         $extension = pathinfo(strtok($uri, '?'), PATHINFO_EXTENSION);
45 44
 
@@ -73,9 +72,9 @@  discard block
 block discarded – undo
73 72
         self::$t['order']['col'] = $orderBy;
74 73
         $dir = strtolower($orderDir);
75 74
         self::$t['order']['dir'] = in_array($dir, ['asc', 'desc']) ?
76
-            $dir : self::error('Invalid orderDir (Asc/Desc): '.$orderDir);
75
+            $dir : self::error('Invalid orderDir (Asc/Desc): ' . $orderDir);
77 76
         self::$t['paging'] = ($num = abs($paging)) >= 10 ?
78
-            $num : self::error('Invalid paging (<10): '.$paging);
77
+            $num : self::error('Invalid paging (<10): ' . $paging);
79 78
     }
80 79
 
81 80
     /**
@@ -94,7 +93,7 @@  discard block
 block discarded – undo
94 93
         self::$t = self::request(self::$export);
95 94
 
96 95
         $order = [self::$t['order']['col'] => self::$t['order']['dir']];
97
-        $offset = (self::$t['page'] - 1) * self::$t['paging'];
96
+        $offset = (self::$t['page'] - 1)*self::$t['paging'];
98 97
         $limit = [$offset, self::$t['paging']];
99 98
         self::$t['q'] = self::query($query, self::$t['filter'], $order, $limit, true);
100 99
 
@@ -107,7 +106,7 @@  discard block
 block discarded – undo
107 106
         try {
108 107
             self::$data = self::select($q);
109 108
         } catch (Exception $e) {
110
-            self::error('ERROR: '.$q.'<br />'.$e->getMessage());
109
+            self::error('ERROR: ' . $q . '<br />' . $e->getMessage());
111 110
         }
112 111
     }
113 112
 
@@ -119,9 +118,8 @@  discard block
 block discarded – undo
119 118
         if (self::$pageExt !== 'json') {
120 119
             echo parent::load();
121 120
         } else {
122
-            $tableId = filter_input(INPUT_GET, 'table-id') ?:
123
-                       filter_var($_GET['table-id'], FILTER_SANITIZE_STRING);
124
-            if ($tableId === self::$t['items'].'-table') {
121
+            $tableId = filter_input(INPUT_GET, 'table-id') ?: filter_var($_GET['table-id'], FILTER_SANITIZE_STRING);
122
+            if ($tableId === self::$t['items'] . '-table') {
125 123
                 //ob_get_clean();
126 124
                 //ob_start('ob_gzhandler');
127 125
                 if (!self::$export) {
Please login to merge, or discard this patch.