@@ -35,7 +35,10 @@ discard block |
||
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 |
||
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 |
||
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 | } |