Passed
Push — master ( 8f17c6...7d9180 )
by RN
03:45
created
src/Dolphin/Save.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,30 +35,30 @@
 block discarded – undo
35 35
         // our object is set. Now we need to save it
36 36
         $queryVal = '';
37 37
         $query = "INSERT INTO ".$this->table()." (";
38
-        foreach($row as $key => $val){
39
-            $query.= $qb->quote($key).", ";
38
+        foreach ($row as $key => $val) {
39
+            $query .= $qb->quote($key).", ";
40 40
             $ar[$key] = $val;
41
-            $queryVal.= ":".$key.", ";
41
+            $queryVal .= ":".$key.", ";
42 42
         }
43 43
 
44 44
         $query = rtrim($query, ", ").") VALUES (".$queryVal.rtrim($query, ", ").") ";
45 45
 
46
-        if(isset($row) && isset($row->id) && $row->id > 0 ){
46
+        if (isset($row) && isset($row->id) && $row->id > 0) {
47 47
             $query = "UPDATE ".$this->table()." SET ";
48
-            foreach($row as $key => $val){
48
+            foreach ($row as $key => $val) {
49 49
                 $ar[':'.$key] = $val;
50
-                if($key == 'id') continue;
51
-                $query.= $qb->quote($key)." =:".$key.",";
50
+                if ($key == 'id') continue;
51
+                $query .= $qb->quote($key)." =:".$key.",";
52 52
             }
53 53
 
54 54
             $query = rtrim($query, ",");
55
-            $query.= " WHERE ".$qb->quote('id')."=:id";
55
+            $query .= " WHERE ".$qb->quote('id')."=:id";
56 56
         }
57 57
 
58
-        try{
58
+        try {
59 59
             $stmt = Connection::get()->prepare($qb->queryPrefix($query));
60 60
             $stmt->execute($ar);
61
-        } catch(Exception $e){
61
+        } catch (Exception $e) {
62 62
             throw new Exception($e->getMessage());
63 63
         }
64 64
 
Please login to merge, or discard this patch.