@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function where(Array $where, String $condition = 'AND'): ?SimplePHP |
92 | 92 | { |
93 | - foreach($where as $enclosures) { |
|
94 | - $split = isset($enclosures[3]) && !$enclosures[3] ? $enclosures[2] : "'".$enclosures[2]."'"; |
|
95 | - $this->where .= $enclosures[0]." ".$enclosures[1]." ".$split." {$condition} "; |
|
93 | + foreach ($where as $enclosures) { |
|
94 | + $split = isset($enclosures[3]) && !$enclosures[3] ? $enclosures[2] : "'" . $enclosures[2] . "'"; |
|
95 | + $this->where .= $enclosures[0] . " " . $enclosures[1] . " " . $split . " {$condition} "; |
|
96 | 96 | } |
97 | 97 | $this->where = "WHERE " . rtrim($this->where, " {$condition} "); |
98 | 98 | |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | public function orWhere(Array $orWhere, String $condition = 'AND'): ?SimplePHP |
118 | 118 | { |
119 | 119 | $moreWhere = ''; |
120 | - foreach($orWhere as $enclosures) { |
|
121 | - $split = isset($enclosures[3]) && !$enclosures[3] ? $enclosures[2] : "'".$enclosures[2]."'"; |
|
122 | - $moreWhere .= $enclosures[0]." ".$enclosures[1]." ".$split." {$condition} "; |
|
120 | + foreach ($orWhere as $enclosures) { |
|
121 | + $split = isset($enclosures[3]) && !$enclosures[3] ? $enclosures[2] : "'" . $enclosures[2] . "'"; |
|
122 | + $moreWhere .= $enclosures[0] . " " . $enclosures[1] . " " . $split . " {$condition} "; |
|
123 | 123 | } |
124 | 124 | $this->where .= " OR " . rtrim($moreWhere, " {$condition} "); |
125 | 125 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function orderBy(String $prop, String $ordenation = 'ASC'): ?SimplePHP |
165 | 165 | { |
166 | - if(mb_strlen($this->order) < 9) { |
|
166 | + if (mb_strlen($this->order) < 9) { |
|
167 | 167 | $this->order = "ORDER BY {$prop} {$ordenation}"; |
168 | 168 | } else { |
169 | 169 | $this->order .= ", {$prop} {$ordenation}"; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function groupBy(String $prop): ?SimplePHP |
179 | 179 | { |
180 | - if(mb_strlen($this->group) < 9) { |
|
180 | + if (mb_strlen($this->group) < 9) { |
|
181 | 181 | $this->group = "GROUP BY {$prop}"; |
182 | 182 | } else { |
183 | 183 | $this->group .= ", {$prop}"; |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function __call(String $name, $arguments) : ?SimplePHP |
194 | 194 | { |
195 | - if($name === 'skip') |
|
195 | + if ($name === 'skip') |
|
196 | 196 | return $this->offset($arguments[0]); |
197 | 197 | |
198 | - if($name === 'take') |
|
198 | + if ($name === 'take') |
|
199 | 199 | return $this->limit($arguments[0]); |
200 | 200 | |
201 | 201 | return $this->writeLog("This method does not exist at the SimplePHP: \"<b>{$name}</b>\"."); |
@@ -192,11 +192,13 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function __call(String $name, $arguments) : ?SimplePHP |
194 | 194 | { |
195 | - if($name === 'skip') |
|
196 | - return $this->offset($arguments[0]); |
|
195 | + if($name === 'skip') { |
|
196 | + return $this->offset($arguments[0]); |
|
197 | + } |
|
197 | 198 | |
198 | - if($name === 'take') |
|
199 | - return $this->limit($arguments[0]); |
|
199 | + if($name === 'take') { |
|
200 | + return $this->limit($arguments[0]); |
|
201 | + } |
|
200 | 202 | |
201 | 203 | return $this->writeLog("This method does not exist at the SimplePHP: \"<b>{$name}</b>\"."); |
202 | 204 | } |
@@ -218,7 +220,9 @@ discard block |
||
218 | 220 | { |
219 | 221 | if (!empty($this->excepts)) { |
220 | 222 | foreach ($this->excepts as $except) { |
221 | - if (isset($this->data[$except])) unset($this->data[$except]); |
|
223 | + if (isset($this->data[$except])) { |
|
224 | + unset($this->data[$except]); |
|
225 | + } |
|
222 | 226 | } |
223 | 227 | } |
224 | 228 | } |