Passed
Pull Request — master (#4)
by Kris
01:54
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.