@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | return $classname . ' {' . implode(', ', array_map( |
90 | - function ($p_0) use ($data) { |
|
90 | + function($p_0) use ($data) { |
|
91 | 91 | $p_0->setAccessible(true); |
92 | 92 | |
93 | 93 | return $p_0->getName() . ': ' . $p_0->getValue($data); |
@@ -164,7 +164,7 @@ |
||
164 | 164 | $prepare = empty($prepare) ? $this->prepare : $prepare; |
165 | 165 | return $prepare->rowCount(); |
166 | 166 | } catch (PDOException $e) { |
167 | - $this->setError($e);} |
|
167 | + $this->setError($e); } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function select(string $fields = '*', string $add = '', array $values = null, bool $returnModel = false, bool $debug = false) |
29 | 29 | { |
30 | - if (strlen($add) > 0) { |
|
30 | + if (strlen($add)>0) { |
|
31 | 31 | $add = ' ' . $add; |
32 | 32 | } |
33 | 33 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $numparams = substr($numparams, 1); |
67 | 67 | $sql = "INSERT INTO {$this->getTable()} ({$fields}) VALUES ({$numparams})"; |
68 | 68 | if ($debug) { |
69 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
69 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | $result = $this->executeSQL($sql, $values); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $sql .= " WHERE $where"; |
149 | 149 | } |
150 | 150 | if ($debug) { |
151 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
151 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
152 | 152 | return; |
153 | 153 | } |
154 | 154 | $result = $this->executeSQL($sql, $values); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $sql .= " WHERE $where"; |
224 | 224 | } |
225 | 225 | if ($debug) { |
226 | - echo $sql.'<pre>'.print_r($values).'</pre>'; |
|
226 | + echo $sql . '<pre>' . print_r($values) . '</pre>'; |
|
227 | 227 | return; |
228 | 228 | } |
229 | 229 | $result = $this->executeSQL($sql, $values); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | public function orderBy(string $texto, $order = null): self |
187 | 187 | { |
188 | 188 | try { |
189 | - $query = "ORDER BY {$texto} ".($order ?? 'ASC')." "; |
|
189 | + $query = "ORDER BY {$texto} " . ($order ?? 'ASC') . " "; |
|
190 | 190 | $this->add($query, "orderBy"); |
191 | 191 | return $this; |
192 | 192 | } catch (\PDOException $e) { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function limit(string $texto): self |
202 | 202 | { |
203 | 203 | $query = "LIMIT {$texto}"; |
204 | - $this->add($query,"limit"); |
|
204 | + $this->add($query, "limit"); |
|
205 | 205 | return $this; |
206 | 206 | } |
207 | 207 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | try { |
215 | 215 | $query = "OFFSET {$texto}"; |
216 | - $this->add($query,"offset"); |
|
216 | + $this->add($query, "offset"); |
|
217 | 217 | return $this; |
218 | 218 | } catch (\PDOException $e) { |
219 | 219 | $this->setError($e); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | { |
229 | 229 | try { |
230 | 230 | $query = "GROUP BY {$texto}"; |
231 | - $this->add($query,"groupBy"); |
|
231 | + $this->add($query, "groupBy"); |
|
232 | 232 | return $this; |
233 | 233 | } catch (\PDOException $e) { |
234 | 234 | $this->setError($e); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | { |
244 | 244 | try { |
245 | 245 | $query = "HAVING {$texto}"; |
246 | - $this->add($query,"having"); |
|
246 | + $this->add($query, "having"); |
|
247 | 247 | return $this; |
248 | 248 | } catch (\PDOException $e) { |
249 | 249 | $this->setError($e); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | { |
259 | 259 | try { |
260 | 260 | $query = "AND {$texto}"; |
261 | - $this->add($query,"andHaving"); |
|
261 | + $this->add($query, "andHaving"); |
|
262 | 262 | return $this; |
263 | 263 | } catch (\PDOException $e) { |
264 | 264 | $this->setError($e); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | try { |
275 | 275 | $query = "OR {$codition}"; |
276 | - $this->add($query,"orHaving"); |
|
276 | + $this->add($query, "orHaving"); |
|
277 | 277 | return $this; |
278 | 278 | } catch (\PDOException $e) { |
279 | 279 | $this->setError($e); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | { |
291 | 291 | try { |
292 | 292 | $query = "INNER JOIN {$table} AS {$alias} ON $codition"; |
293 | - $this->add($query,"join"); |
|
293 | + $this->add($query, "join"); |
|
294 | 294 | return $this; |
295 | 295 | } catch (\PDOException $e) { |
296 | 296 | $this->setError($e); |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | { |
308 | 308 | try { |
309 | 309 | $query = "LEFT JOIN {$table} AS {$alias} ON {$codition}"; |
310 | - $this->add($query,"join"); |
|
310 | + $this->add($query, "join"); |
|
311 | 311 | return $this; |
312 | 312 | } catch (\PDOException $e) { |
313 | 313 | $this->setError($e); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | { |
325 | 325 | try { |
326 | 326 | $query = "RIGHT JOIN {$table} AS {$alias} ON $codition"; |
327 | - $this->add($query,"join"); |
|
327 | + $this->add($query, "join"); |
|
328 | 328 | return $this; |
329 | 329 | } catch (\PDOException $e) { |
330 | 330 | $this->setError($e); |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | public function executeQuery(): self |
338 | 338 | { |
339 | 339 | try { |
340 | - foreach ($this->sqlPartsSelect as $key => $part){ |
|
340 | + foreach ($this->sqlPartsSelect as $key => $part) { |
|
341 | 341 | if (is_array($part)) { |
342 | - foreach ($part as $item){ |
|
342 | + foreach ($part as $item) { |
|
343 | 343 | $this->query .= $item; |
344 | 344 | } |
345 | 345 | } else { |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | |
401 | 401 | private function add(string $text, string $type, array $params = []) |
402 | 402 | { |
403 | - $text = $text." "; |
|
403 | + $text = $text . " "; |
|
404 | 404 | try { |
405 | 405 | if (is_array($this->sqlPartsSelect[$type])) { |
406 | 406 | $this->sqlPartsSelect[$type][] = $text; |