@@ -200,14 +200,14 @@ |
||
200 | 200 | $out .= '<fieldset style="text-align:left">'; |
201 | 201 | $out .= '<legend>Query ' . $i . ' - ' . sprintf($this->timeFormat, $query['time']) . '</legend>'; |
202 | 202 | $out .= $query['sql'] . '<br><br>'; |
203 | - if (! empty($query['element'])) { |
|
203 | + if (!empty($query['element'])) { |
|
204 | 204 | $out .= $query['element']['type'] . ' => ' . $query['element']['name'] . '<br>'; |
205 | 205 | } |
206 | - if (! empty($query['event'])) { |
|
206 | + if (!empty($query['event'])) { |
|
207 | 207 | $out .= 'Current Event => ' . $query['event'] . '<br>'; |
208 | 208 | } |
209 | 209 | $out .= 'Affected Rows => ' . $query['rows'] . '<br>'; |
210 | - if (! empty($query['path'])) { |
|
210 | + if (!empty($query['path'])) { |
|
211 | 211 | $out .= 'Functions Path => ' . $query['path'] . '<br>'; |
212 | 212 | } |
213 | 213 | /*$out .= 'Functions Path => ' . $query['path']['method'] . '<br>'; |
@@ -51,11 +51,11 @@ |
||
51 | 51 | protected function convertValue($value) |
52 | 52 | { |
53 | 53 | switch (true) { |
54 | - case (\is_numeric($value) && ! \is_float(1 * $value)): |
|
55 | - $value = (int)$value; |
|
54 | + case (\is_numeric($value) && !\is_float(1 * $value)): |
|
55 | + $value = (int) $value; |
|
56 | 56 | break; |
57 | - case \is_numeric($value) && \is_float(1*$value): |
|
58 | - $value = (float)$value; |
|
57 | + case \is_numeric($value) && \is_float(1 * $value): |
|
58 | + $value = (float) $value; |
|
59 | 59 | break; |
60 | 60 | default: |
61 | 61 | break; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getConnect() : mysqli |
81 | 81 | { |
82 | - if (! $this->isConnected()) { |
|
82 | + if (!$this->isConnected()) { |
|
83 | 83 | return $this->connect(); |
84 | 84 | } |
85 | 85 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | throw new Exceptions\ConnectException($this->conn->connect_error); |
107 | 107 | } |
108 | 108 | |
109 | - if (! $this->isConnected()) { |
|
109 | + if (!$this->isConnected()) { |
|
110 | 110 | throw new Exceptions\ConnectException( |
111 | 111 | $this->getLastError() ?: 'Failed to create the database connection!' |
112 | 112 | ); |
@@ -314,13 +314,12 @@ discard block |
||
314 | 314 | |
315 | 315 | if (\is_array($fields)) { |
316 | 316 | $useFields = empty($fromTable) ? |
317 | - $this->prepareValues($fields) : |
|
318 | - $this->prepareFields($fields, true); |
|
317 | + $this->prepareValues($fields) : $this->prepareFields($fields, true); |
|
319 | 318 | } else { |
320 | 319 | $useFields = $fields; |
321 | 320 | } |
322 | 321 | |
323 | - if (empty($useFields) || ! \is_scalar($useFields) || ($useFields === '*' && ! empty($fromTable))) { |
|
322 | + if (empty($useFields) || !\is_scalar($useFields) || ($useFields === '*' && !empty($fromTable))) { |
|
324 | 323 | throw (new Exceptions\InvalidFieldException('Invalid insert fields')) |
325 | 324 | ->setData($fields); |
326 | 325 | } |
@@ -367,7 +366,7 @@ discard block |
||
367 | 366 | $mode = 'insert'; |
368 | 367 | } else { |
369 | 368 | $result = $this->select('*', $table, $where); |
370 | - if (! $result instanceof mysqli_result) { |
|
369 | + if (!$result instanceof mysqli_result) { |
|
371 | 370 | throw (new Exceptions\QueryException('Need mysqli_result')) |
372 | 371 | ->setQuery($this->getLastQuery()); |
373 | 372 | } |
@@ -404,7 +403,7 @@ discard block |
||
404 | 403 | * @param int $col |
405 | 404 | * @return string|null |
406 | 405 | */ |
407 | - public function fieldName(mysqli_result $result, $col = 0) :? string |
|
406 | + public function fieldName(mysqli_result $result, $col = 0) : ? string |
|
408 | 407 | { |
409 | 408 | $field = $result->fetch_field_direct($col); |
410 | 409 | |
@@ -501,7 +500,7 @@ discard block |
||
501 | 500 | { |
502 | 501 | $col = []; |
503 | 502 | |
504 | - if (! ($result instanceof mysqli_result)) { |
|
503 | + if (!($result instanceof mysqli_result)) { |
|
505 | 504 | $result = $this->query($result); |
506 | 505 | } |
507 | 506 | |
@@ -525,7 +524,7 @@ discard block |
||
525 | 524 | { |
526 | 525 | $names = []; |
527 | 526 | |
528 | - if (! ($result instanceof mysqli_result)) { |
|
527 | + if (!($result instanceof mysqli_result)) { |
|
529 | 528 | $result = $this->query($result); |
530 | 529 | } |
531 | 530 | |
@@ -550,7 +549,7 @@ discard block |
||
550 | 549 | { |
551 | 550 | $out = false; |
552 | 551 | |
553 | - if (! ($result instanceof mysqli_result)) { |
|
552 | + if (!($result instanceof mysqli_result)) { |
|
554 | 553 | $result = $this->query($result); |
555 | 554 | } |
556 | 555 | |
@@ -572,7 +571,7 @@ discard block |
||
572 | 571 | public function getTableMetaData(string $table) : array |
573 | 572 | { |
574 | 573 | $metadata = []; |
575 | - if (! empty($table)) { |
|
574 | + if (!empty($table)) { |
|
576 | 575 | $sql = 'SHOW FIELDS FROM ' . $table; |
577 | 576 | $result = $this->query($sql); |
578 | 577 | if ($result instanceof mysqli_result) { |