@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getConnect() |
141 | 141 | { |
142 | - if (! $this->isConnected()) { |
|
142 | + if (!$this->isConnected()) { |
|
143 | 143 | $this->connect(); |
144 | - if (! $this->conn->getPdo() instanceof PDO) { |
|
144 | + if (!$this->conn->getPdo() instanceof PDO) { |
|
145 | 145 | $this->conn->reconnect(); |
146 | 146 | } |
147 | 147 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function connect() |
167 | 167 | { |
168 | 168 | try { |
169 | - if (! $this->hasConnectionName($this->connection)) { |
|
169 | + if (!$this->hasConnectionName($this->connection)) { |
|
170 | 170 | $this->getCapsule()->addConnection([ |
171 | 171 | 'driver' => $this->driver, |
172 | 172 | 'host' => $this->config['host'], |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | } |
274 | 274 | $query = $method . ' ' . $charset . ' COLLATE ' . $collation; |
275 | 275 | |
276 | - return (bool)$this->query($query); |
|
276 | + return (bool) $this->query($query); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | { |
463 | 463 | $pdo = $this->getConnect()->getPdo(); |
464 | 464 | $error = $pdo->errorInfo(); |
465 | - return (string)(isset($error[2]) ? $error[2] : $this->lastError[2]); |
|
465 | + return (string) (isset($error[2]) ? $error[2] : $this->lastError[2]); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | { |
474 | 474 | $pdo = $this->getConnect()->getPdo(); |
475 | 475 | $error = $pdo->errorInfo(); |
476 | - return (string)(isset($error[1]) ? $error[1] : $this->lastErrorNo); |
|
476 | + return (string) (isset($error[1]) ? $error[1] : $this->lastErrorNo); |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function setDriver($driver) |
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 | ); |
@@ -319,13 +319,12 @@ discard block |
||
319 | 319 | |
320 | 320 | if (\is_array($fields)) { |
321 | 321 | $useFields = empty($fromTable) ? |
322 | - $this->prepareValues($fields) : |
|
323 | - $this->prepareFields($fields, true); |
|
322 | + $this->prepareValues($fields) : $this->prepareFields($fields, true); |
|
324 | 323 | } else { |
325 | 324 | $useFields = $fields; |
326 | 325 | } |
327 | 326 | |
328 | - if (empty($useFields) || ! \is_scalar($useFields) || ($useFields === '*' && ! empty($fromTable))) { |
|
327 | + if (empty($useFields) || !\is_scalar($useFields) || ($useFields === '*' && !empty($fromTable))) { |
|
329 | 328 | throw (new Exceptions\InvalidFieldException('Invalid insert fields')) |
330 | 329 | ->setData($fields); |
331 | 330 | } |
@@ -494,7 +493,7 @@ discard block |
||
494 | 493 | public function getTableMetaData($table) |
495 | 494 | { |
496 | 495 | $metadata = []; |
497 | - if (! empty($table)) { |
|
496 | + if (!empty($table)) { |
|
498 | 497 | $sql = 'SHOW FIELDS FROM ' . $table; |
499 | 498 | $result = $this->query($sql); |
500 | 499 | $metadata = $this->getDriver()->getTableMetaData($result); |