@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($message = "", $code = 0, Throwable $previous = null) |
| 14 | 14 | { |
| 15 | - parent::__construct($message, (int)$code, $previous); |
|
| 15 | + parent::__construct($message, (int) $code, $previous); |
|
| 16 | 16 | |
| 17 | 17 | $this->code = $code; |
| 18 | 18 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function getConnect() : Connection |
| 57 | 57 | { |
| 58 | - if (! $this->isConnected()) { |
|
| 58 | + if (!$this->isConnected()) { |
|
| 59 | 59 | return $this->connect(); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $method = $this->config['method']; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - return (bool)$this->query($method . ' ' . $charset . ' COLLATE ' . $collation); |
|
| 175 | + return (bool) $this->query($method . ' ' . $charset . ' COLLATE ' . $collation); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @param int $col |
| 199 | 199 | * @return string|null |
| 200 | 200 | */ |
| 201 | - public function fieldName($result, $col = 0) :? string |
|
| 201 | + public function fieldName($result, $col = 0) : ? string |
|
| 202 | 202 | { |
| 203 | 203 | $field = $result->getColumnMeta($col); |
| 204 | 204 | return $field['name'] ?? null; |
@@ -356,18 +356,18 @@ discard block |
||
| 356 | 356 | * @return string|null |
| 357 | 357 | * @throws Exceptions\Exception |
| 358 | 358 | */ |
| 359 | - public function getLastError() :? string |
|
| 359 | + public function getLastError() : ? string |
|
| 360 | 360 | { |
| 361 | - return (string)($this->getConnect()->getPdo()->errorInfo()[2] ?? $this->lastError[2]); |
|
| 361 | + return (string) ($this->getConnect()->getPdo()->errorInfo()[2] ?? $this->lastError[2]); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /** |
| 365 | 365 | * @return string|null |
| 366 | 366 | * @throws Exceptions\Exception |
| 367 | 367 | */ |
| 368 | - public function getLastErrorNo() :? string |
|
| 368 | + public function getLastErrorNo() : ? string |
|
| 369 | 369 | { |
| 370 | - return (string)($this->getConnect()->getPdo()->errorInfo()[1] ?? $this->lastErrorNo); |
|
| 370 | + return (string) ($this->getConnect()->getPdo()->errorInfo()[1] ?? $this->lastErrorNo); |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getConnect() |
| 39 | 39 | { |
| 40 | - if (! $this->isConnected()) { |
|
| 40 | + if (!$this->isConnected()) { |
|
| 41 | 41 | return $this->connect(); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | throw new Exceptions\ConnectException($this->conn->connect_error); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (! $this->isConnected()) { |
|
| 65 | + if (!$this->isConnected()) { |
|
| 66 | 66 | throw new Exceptions\ConnectException( |
| 67 | 67 | $this->getLastError() ?: 'Failed to create the database connection!' |
| 68 | 68 | ); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * @param int $col |
| 180 | 180 | * @return string|null |
| 181 | 181 | */ |
| 182 | - public function fieldName($result, $col = 0) :? string |
|
| 182 | + public function fieldName($result, $col = 0) : ? string |
|
| 183 | 183 | { |
| 184 | 184 | $field = $result->fetch_field_direct($col); |
| 185 | 185 | |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @return string|null |
| 324 | 324 | * @throws Exceptions\Exception |
| 325 | 325 | */ |
| 326 | - public function getLastError() :? string |
|
| 326 | + public function getLastError() : ? string |
|
| 327 | 327 | { |
| 328 | 328 | return $this->getConnect()->error; |
| 329 | 329 | } |
@@ -332,9 +332,9 @@ discard block |
||
| 332 | 332 | * @return string|null |
| 333 | 333 | * @throws Exceptions\Exception |
| 334 | 334 | */ |
| 335 | - public function getLastErrorNo() :? string |
|
| 335 | + public function getLastErrorNo() : ? string |
|
| 336 | 336 | { |
| 337 | - return (string)$this->getConnect()->errno; |
|
| 337 | + return (string) $this->getConnect()->errno; |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | 'collation' |
| 57 | 57 | )); |
| 58 | 58 | |
| 59 | - if (! \in_array(Interfaces\DriverInterface::class, class_implements($driver), true)) { |
|
| 59 | + if (!\in_array(Interfaces\DriverInterface::class, class_implements($driver), true)) { |
|
| 60 | 60 | throw new Exceptions\DriverException( |
| 61 | 61 | $driver . ' should implements the ' . Interfaces\DriverInterface::class |
| 62 | 62 | ); |
@@ -282,13 +282,12 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | if (\is_array($fields)) { |
| 284 | 284 | $useFields = empty($fromTable) ? |
| 285 | - $this->prepareValues($fields) : |
|
| 286 | - $this->prepareFields($fields, true); |
|
| 285 | + $this->prepareValues($fields) : $this->prepareFields($fields, true); |
|
| 287 | 286 | } else { |
| 288 | 287 | $useFields = $fields; |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | - if (empty($useFields) || ! \is_scalar($useFields) || ($useFields === '*' && ! empty($fromTable))) { |
|
| 290 | + if (empty($useFields) || !\is_scalar($useFields) || ($useFields === '*' && !empty($fromTable))) { |
|
| 292 | 291 | throw (new Exceptions\InvalidFieldException('Invalid insert fields')) |
| 293 | 292 | ->setData($fields); |
| 294 | 293 | } |
@@ -365,7 +364,7 @@ discard block |
||
| 365 | 364 | * @param int $col |
| 366 | 365 | * @return string|null |
| 367 | 366 | */ |
| 368 | - public function fieldName($result, $col = 0) :? string |
|
| 367 | + public function fieldName($result, $col = 0) : ? string |
|
| 369 | 368 | { |
| 370 | 369 | return $this->getDriver()->fieldName($result, $col); |
| 371 | 370 | } |
@@ -480,7 +479,7 @@ discard block |
||
| 480 | 479 | public function getTableMetaData(string $table) : array |
| 481 | 480 | { |
| 482 | 481 | $metadata = []; |
| 483 | - if (! empty($table)) { |
|
| 482 | + if (!empty($table)) { |
|
| 484 | 483 | $sql = 'SHOW FIELDS FROM ' . $table; |
| 485 | 484 | $result = $this->query($sql); |
| 486 | 485 | $metadata = $this->getDriver()->getTableMetaData($result); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param int $col |
| 80 | 80 | * @return null|string |
| 81 | 81 | */ |
| 82 | - public function fieldName($result, $col = 0) :? string; |
|
| 82 | + public function fieldName($result, $col = 0) : ? string; |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * @param string $name |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | /** |
| 129 | 129 | * @return string|null |
| 130 | 130 | */ |
| 131 | - public function getLastError() :? string; |
|
| 131 | + public function getLastError() : ? string; |
|
| 132 | 132 | |
| 133 | 133 | /** |
| 134 | 134 | * @return string|null |
| 135 | 135 | */ |
| 136 | - public function getLastErrorNo() :? string; |
|
| 136 | + public function getLastErrorNo() : ? string; |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * @param $result |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @return string|null |
| 44 | 44 | * @throws Exceptions\Exception |
| 45 | 45 | */ |
| 46 | - public function getLastError() :? string |
|
| 46 | + public function getLastError() : ? string |
|
| 47 | 47 | { |
| 48 | 48 | return $this->getDriver()->getLastError(); |
| 49 | 49 | } |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * @return string|null |
| 53 | 53 | * @throws Exceptions\Exception |
| 54 | 54 | */ |
| 55 | - public function getLastErrorNo() :? string |
|
| 55 | + public function getLastErrorNo() : ? string |
|
| 56 | 56 | { |
| 57 | - return (string)$this->getDriver()->getLastErrorNo(); |
|
| 57 | + return (string) $this->getDriver()->getLastErrorNo(); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | $out .= '<fieldset style="text-align:left">'; |
| 193 | 193 | $out .= '<legend>Query ' . $i . ' - ' . sprintf($this->timeFormat, $query['time']) . '</legend>'; |
| 194 | 194 | $out .= $query['sql'] . '<br><br>'; |
| 195 | - if (! empty($query['element'])) { |
|
| 195 | + if (!empty($query['element'])) { |
|
| 196 | 196 | $out .= $query['element']['type'] . ' => ' . $query['element']['name'] . '<br>'; |
| 197 | 197 | } |
| 198 | - if (! empty($query['event'])) { |
|
| 198 | + if (!empty($query['event'])) { |
|
| 199 | 199 | $out .= 'Current Event => ' . $query['event'] . '<br>'; |
| 200 | 200 | } |
| 201 | 201 | $out .= 'Affected Rows => ' . $query['rows'] . '<br>'; |
| 202 | - if (! empty($query['path'])) { |
|
| 202 | + if (!empty($query['path'])) { |
|
| 203 | 203 | $out .= 'Functions Path => ' . $query['path'] . '<br>'; |
| 204 | 204 | } |
| 205 | 205 | /*$out .= 'Functions Path => ' . $query['path']['method'] . '<br>'; |