Completed
Pull Request — master (#4)
by Kris
03:23 queued 01:34
created
lib/Query/QueryBuilder.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      *
139 139
      * @return string
140 140
      */
141
-    public function __construct( $driver)
141
+    public function __construct($driver)
142 142
     {
143 143
         $this->driver = $driver;
144 144
     }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             }
203 203
 
204 204
             // register error 
205
-            $this->error['code'] = (int)$e->getCode();
205
+            $this->error['code'] = (int) $e->getCode();
206 206
             $this->error['message'] = $e->getMessage();
207 207
             return false;
208 208
         }
@@ -226,13 +226,13 @@  discard block
 block discarded – undo
226 226
                 $paramType = \PDO::PARAM_STR; // default
227 227
 
228 228
                 if (!isset($val)) {
229
-                    $paramType =  \PDO::PARAM_NULL;
229
+                    $paramType = \PDO::PARAM_NULL;
230 230
                 
231 231
                 } elseif (is_int($val)) {
232
-                    $paramType =  \PDO::PARAM_INT;
232
+                    $paramType = \PDO::PARAM_INT;
233 233
                 
234 234
                 } elseif (is_bool($val)) {
235
-                    $paramType =  \PDO::PARAM_BOOL;
235
+                    $paramType = \PDO::PARAM_BOOL;
236 236
                 } 
237 237
                 
238 238
                 // bind value
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
     {
252 252
         try {
253 253
             // prepare bind execute
254
-            if (!isset($this->pdoStatement)){
255
-               if (!$this->prepare()){
254
+            if (!isset($this->pdoStatement)) {
255
+               if (!$this->prepare()) {
256 256
                    return false;
257 257
                }
258 258
             }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             }
268 268
 
269 269
             // register error 
270
-            $this->error['code'] = (int)$e->getCode();
270
+            $this->error['code'] = (int) $e->getCode();
271 271
             $this->error['message'] = $e->getMessage();
272 272
             return false;
273 273
         }
@@ -297,23 +297,23 @@  discard block
 block discarded – undo
297 297
      */
298 298
     protected static function fetchOutput(QueryBuilder $query, $executed, $outputFormat)
299 299
     {
300
-        switch (strtoupper($outputFormat)){
300
+        switch (strtoupper($outputFormat)) {
301 301
 
302 302
             case Outpout::ASSOC:    
303
-                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) :  array();
303
+                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) : array();
304 304
 
305 305
             case Outpout::OBJ:    
306
-                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_OBJ) :    array();
306
+                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_OBJ) : array();
307 307
 
308 308
             case Outpout::COLUMN:    
309
-                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_COLUMN) :  array();
309
+                return $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_COLUMN) : array();
310 310
 
311 311
             case Outpout::JSON:
312
-                $results = $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) :  array();
312
+                $results = $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) : array();
313 313
                 return json_encode($results, JSON_NUMERIC_CHECK);   
314 314
 
315 315
             case Outpout::JSON_PRETTY_PRINT:    
316
-                $results = $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) :  array();
316
+                $results = $executed ? $query->pdoStatement->fetchAll(\PDO::FETCH_ASSOC) : array();
317 317
                 return json_encode($results, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);   
318 318
                 
319 319
             default:
Please login to merge, or discard this patch.
lib/Query/Select.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 case 'sub_query':
106 106
                     $colsList[] = '('. $val['query']->sql() .') AS '. $this->escape($val['alias']);
107 107
                     break;
108
-           }
108
+            }
109 109
         }
110 110
         return $sqlDistinct . implode(', ', $colsList);
111 111
     }
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
         }
154 154
 
155 155
         return trim(implode(' ', ['SELECT', 
156
-           $this->sqlColumns(), 
157
-           $sqlFromTable,
158
-           $sqlJoins,
159
-           $sqlWhere,
160
-           $sqlGroupBy,
161
-           $sqlHaving,
162
-           $sqlOrderBy,
163
-           $sqlLimit,
164
-           $sqlOffset]));
156
+            $this->sqlColumns(), 
157
+            $sqlFromTable,
158
+            $sqlJoins,
159
+            $sqlWhere,
160
+            $sqlGroupBy,
161
+            $sqlHaving,
162
+            $sqlOrderBy,
163
+            $sqlLimit,
164
+            $sqlOffset]));
165 165
     }
166 166
      
167 167
     /**
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
     public function getAll(string $outputFormat = 'default')
176 176
     {
177 177
         // execute query
178
-       $exec = $this->execute();
178
+        $exec = $this->execute();
179 179
 
180
-       // format
181
-       $format = ($outputFormat === 'default') ? $this->driver->defaultOutputFormat() : $outputFormat; 
180
+        // format
181
+        $format = ($outputFormat === 'default') ? $this->driver->defaultOutputFormat() : $outputFormat; 
182 182
 
183 183
         // return output
184 184
         return QueryBuilder::fetchOutput($this, $exec, $format);
Please login to merge, or discard this patch.
lib/Driver/DatabaseDriver.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  */
34 34
 abstract class DatabaseDriver
35 35
 {
36
-   /**
36
+    /**
37 37
      * PDO connection
38 38
      *
39 39
      * @access protected
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
      * @var string
75 75
      */
76 76
     public function sqlCreateTableOptions()
77
-     {
77
+        {
78 78
         return '';    
79
-     } 
79
+        } 
80 80
 
81 81
     /**
82 82
      * Gets/returns the default output format 
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function escape($str)
137 137
     {
138
-       $list = explode('.', $str);
139
-       return implode('.', $this->escapeList($list));
138
+        $list = explode('.', $str);
139
+        return implode('.', $this->escapeList($list));
140 140
     }
141 141
 
142 142
     /**
Please login to merge, or discard this patch.