Completed
Push — master ( cb008d...9c72bc )
by Francis
01:53
created
libraries/RefactorCI.php 1 patch
Braces   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,10 @@  discard block
 block discarded – undo
35 35
       $rule = is_array($ruleName) ? $ruleName : null;
36 36
     }
37 37
 
38
-    if ($rule == null) return; // No need to go further as rule doesn't exist.
38
+    if ($rule == null) {
39
+        return;
40
+    }
41
+    // No need to go further as rule doesn't exist.
39 42
     // Keep
40 43
     if (isset($rule['keep'])) {
41 44
       $keys = array_keys($object);
@@ -76,11 +79,15 @@  discard block
 block discarded – undo
76 79
             continue;
77 80
           }
78 81
           $object[$field] = $query->result_array()[0];
79
-          if (isset($data['refactor'])) $this->run($object[$field], $data['refactor']);
82
+          if (isset($data['refactor'])) {
83
+              $this->run($object[$field], $data['refactor']);
84
+          }
80 85
           continue;
81 86
         }
82 87
         $object[$field] = [];
83
-        if ($ids == null) return;
88
+        if ($ids == null) {
89
+            return;
90
+        }
84 91
         foreach($ids as $id) {
85 92
           $this->ci->db->where($this->primaryKey, $id);
86 93
           $query = $this->ci->db->get($data['table']);
@@ -89,7 +96,9 @@  discard block
 block discarded – undo
89 96
           }
90 97
           $object[$field][] = $query->result_array()[0];
91 98
           // Recursion
92
-          if (isset($data['refactor'])) $this->run($object[$field][count($object[$field]) - 1], $data['refactor']);
99
+          if (isset($data['refactor'])) {
100
+              $this->run($object[$field][count($object[$field]) - 1], $data['refactor']);
101
+          }
93 102
         }
94 103
       }
95 104
     }
Please login to merge, or discard this patch.