Passed
Push — master ( 36c8a5...213898 )
by RN
01:43
created
src/Dolphin/Parsers/WhereQueryParser.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $ar = [];
34 34
         if(!count($whereQuery)){
35
-          return $ar;
35
+            return $ar;
36 36
         }
37 37
 
38 38
         foreach ($whereQuery as $where) {
Please login to merge, or discard this patch.
src/Dolphin/Builders/UpdateQueryBuilder.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
      * @since v0.0.8
27 27
      */
28 28
     public function update(
29
-      $row,
30
-      $table,
31
-      $where,
32
-      $whereRaw,
33
-      $whereIn,
34
-      $whereNotIn,
35
-      $whereNull,
36
-      $whereNotNull
29
+        $row,
30
+        $table,
31
+        $where,
32
+        $whereRaw,
33
+        $whereIn,
34
+        $whereNotIn,
35
+        $whereNull,
36
+        $whereNotNull
37 37
     ): bool
38 38
     {
39 39
         $wqb   = new WhereQueryBuilder();
Please login to merge, or discard this patch.
src/Dolphin/Builders/InsertQueryBuilder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     }
66 66
 
67 67
     private function checkMultipleInsert($rows = []){
68
-      return is_array($rows) && isset($rows[0]) && is_array($rows[0]);
68
+        return is_array($rows) && isset($rows[0]) && is_array($rows[0]);
69 69
     }
70 70
     /**
71 71
      * It inserts the new rows
Please login to merge, or discard this patch.
src/Dolphin/Builders/DeleteQueryBuilder.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
      * @since v0.0.8
27 27
      */
28 28
     public function delete(
29
-      $table,
30
-      $where,
31
-      $whereRaw,
32
-      $whereIn,
33
-      $whereNotIn,
34
-      $whereNull,
35
-      $whereNotNull
29
+        $table,
30
+        $where,
31
+        $whereRaw,
32
+        $whereIn,
33
+        $whereNotIn,
34
+        $whereNull,
35
+        $whereNotNull
36 36
     ): bool
37 37
     {
38 38
         $wqb = new WhereQueryBuilder();
Please login to merge, or discard this patch.
src/Dolphin/Builders/PrepareQueryBuilder.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 class PrepareQueryBuilder extends QueryBuilder
20 20
 {
21 21
     private function checkCountable($results = null ): bool{
22
-       return (is_array($results) || is_object($results)) && count($results);
22
+        return (is_array($results) || is_object($results)) && count($results);
23 23
     }
24 24
 
25 25
     /**
@@ -31,33 +31,33 @@  discard block
 block discarded – undo
31 31
      * @author RN Kushwaha <[email protected]>
32 32
      * @since v0.0.5
33 33
      */
34
-     public function prepare($where, $className, $query, $fetchRows = 'all')
35
-     {
36
-         $wqp  = new WhereQueryParser();
37
-         $util = new Utils();
38
-         $rows = null;
39
-
40
-         try {
41
-             $ar = $wqp->parseWhereQuery($where);
42
-             $stmt = Connection::get()->prepare($this->queryPrefix($query));
43
-             $stmt->execute($ar);
44
-
45
-             if ($fetchRows == 'first') {
46
-                 $results = $stmt->fetch(\PDO::FETCH_ASSOC);
47
-             } else{
48
-                 $results = $stmt->fetchAll(\PDO::FETCH_ASSOC);
49
-             }
50
-
51
-             if($this->checkCountable($results) ){
52
-               // now turn this stdClass object to the object type of calling model
53
-               $rows = $util->turnObjects($className, $results);
54
-             }
55
-
56
-             return $rows;
57
-         } catch (\PDOException $ex) {
58
-             throw new \PDOException($ex->getMessage(), 1);
59
-         } catch (Exception $e) {
60
-             throw new Exception($e->getMessage(), 1);
61
-         }
62
-     }
34
+        public function prepare($where, $className, $query, $fetchRows = 'all')
35
+        {
36
+            $wqp  = new WhereQueryParser();
37
+            $util = new Utils();
38
+            $rows = null;
39
+
40
+            try {
41
+                $ar = $wqp->parseWhereQuery($where);
42
+                $stmt = Connection::get()->prepare($this->queryPrefix($query));
43
+                $stmt->execute($ar);
44
+
45
+                if ($fetchRows == 'first') {
46
+                    $results = $stmt->fetch(\PDO::FETCH_ASSOC);
47
+                } else{
48
+                    $results = $stmt->fetchAll(\PDO::FETCH_ASSOC);
49
+                }
50
+
51
+                if($this->checkCountable($results) ){
52
+                // now turn this stdClass object to the object type of calling model
53
+                $rows = $util->turnObjects($className, $results);
54
+                }
55
+
56
+                return $rows;
57
+            } catch (\PDOException $ex) {
58
+                throw new \PDOException($ex->getMessage(), 1);
59
+            } catch (Exception $e) {
60
+                throw new Exception($e->getMessage(), 1);
61
+            }
62
+        }
63 63
 }
Please login to merge, or discard this patch.
src/Dolphin/Save.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@
 block discarded – undo
23 23
     }
24 24
 
25 25
     public function buildQueryStrSingleFromArr($row = []){
26
-      $ar = [];
27
-      $query = "UPDATE ".$this->table." SET ";
28
-      foreach($row as $key => $val){
29
-          $ar[':'.$key] = $val;
30
-          if($key == 'id') continue;
31
-          $query.= $this->qb->quote($key)." =:".$key.",";
32
-      }
33
-      $query = rtrim($query, ",");
26
+        $ar = [];
27
+        $query = "UPDATE ".$this->table." SET ";
28
+        foreach($row as $key => $val){
29
+            $ar[':'.$key] = $val;
30
+            if($key == 'id') continue;
31
+            $query.= $this->qb->quote($key)." =:".$key.",";
32
+        }
33
+        $query = rtrim($query, ",");
34 34
 
35
-      return ['ar' => $ar, 'query' => $query];
35
+        return ['ar' => $ar, 'query' => $query];
36 36
     }
37 37
     public function createQuery($row){
38 38
         $ar = [];
Please login to merge, or discard this patch.
src/Dolphin/Dolphin.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
     public function update($row)
375 375
     {
376 376
         $result =  (new UpdateQueryBuilder())->update(
377
-          $row,
378
-          $this->table,
379
-          $this->where,
380
-          $this->whereRaw,
381
-          $this->whereIn,
382
-          $this->whereNotIn,
383
-          $this->whereNull,
384
-          $this->whereNotNull
377
+            $row,
378
+            $this->table,
379
+            $this->where,
380
+            $this->whereRaw,
381
+            $this->whereIn,
382
+            $this->whereNotIn,
383
+            $this->whereNull,
384
+            $this->whereNotNull
385 385
         );
386 386
 
387 387
         $this->reset();
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
     public function delete()
421 421
     {
422 422
         $result =  (new DeleteQueryBuilder())->delete(
423
-          $this->table,
424
-          $this->where,
425
-          $this->whereRaw,
426
-          $this->whereIn,
427
-          $this->whereNotIn,
428
-          $this->whereNull,
429
-          $this->whereNotNull
423
+            $this->table,
424
+            $this->where,
425
+            $this->whereRaw,
426
+            $this->whereIn,
427
+            $this->whereNotIn,
428
+            $this->whereNull,
429
+            $this->whereNotNull
430 430
         );
431 431
 
432 432
         $this->reset();
Please login to merge, or discard this patch.