@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getLastErrorNo() |
| 31 | 31 | { |
| 32 | - return (string)$this->getDriver()->getLastErrorNo(); |
|
| 32 | + return (string) $this->getDriver()->getLastErrorNo(); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | public function getTableMetaData($table) |
| 264 | 264 | { |
| 265 | 265 | $metadata = []; |
| 266 | - if (! empty($table)) { |
|
| 266 | + if (!empty($table)) { |
|
| 267 | 267 | $sql = 'SHOW FIELDS FROM ' . $table; |
| 268 | 268 | $result = $this->query($sql); |
| 269 | 269 | $metadata = $this->getDriver()->getTableMetaData($result); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function setDriver($driver) |
| 287 | 287 | { |
| 288 | - if (! \in_array(Interfaces\DriverInterface::class, class_implements($driver), true)) { |
|
| 288 | + if (!\in_array(Interfaces\DriverInterface::class, class_implements($driver), true)) { |
|
| 289 | 289 | throw new Exceptions\DriverException( |
| 290 | 290 | $driver . ' should implements the ' . Interfaces\DriverInterface::class |
| 291 | 291 | ); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $table = $this->prepareFrom($table); |
| 379 | 379 | $useFields = \is_array($fields) ? $this->prepareValues($fields) : $fields; |
| 380 | 380 | |
| 381 | - if (empty($useFields) || ! \is_scalar($useFields) || $useFields === '*') { |
|
| 381 | + if (empty($useFields) || !\is_scalar($useFields) || $useFields === '*') { |
|
| 382 | 382 | throw (new Exceptions\InvalidFieldException('Invalid insert fields')) |
| 383 | 383 | ->setData($fields); |
| 384 | 384 | } |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | $table = $this->prepareFrom($table); |
| 418 | 418 | $useFields = \is_array($fields) ? $this->prepareFields($fields, true) : $fields; |
| 419 | 419 | |
| 420 | - if (empty($useFields) || ! \is_scalar($useFields) || $useFields === '*') { |
|
| 420 | + if (empty($useFields) || !\is_scalar($useFields) || $useFields === '*') { |
|
| 421 | 421 | throw (new Exceptions\InvalidFieldException('Invalid insert fields')) |
| 422 | 422 | ->setData($fields); |
| 423 | 423 | } |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | /** |
| 528 | 528 | * {@inheritDoc} |
| 529 | 529 | */ |
| 530 | - public function begin ($flag = 0, $name = null) |
|
| 530 | + public function begin($flag = 0, $name = null) |
|
| 531 | 531 | { |
| 532 | 532 | return $this->getDriver()->begin($flag, $name); |
| 533 | 533 | } |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | /** |
| 536 | 536 | * {@inheritDoc} |
| 537 | 537 | */ |
| 538 | - public function commit ($flag = 0, $name = null) |
|
| 538 | + public function commit($flag = 0, $name = null) |
|
| 539 | 539 | { |
| 540 | 540 | return $this->getDriver()->commit($flag, $name); |
| 541 | 541 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | /** |
| 544 | 544 | * {@inheritDoc} |
| 545 | 545 | */ |
| 546 | - public function rollback ($flag = 0, $name = null) |
|
| 546 | + public function rollback($flag = 0, $name = null) |
|
| 547 | 547 | { |
| 548 | 548 | return $this->getDriver()->rollback($flag, $name); |
| 549 | 549 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function getConnect() |
| 31 | 31 | { |
| 32 | - if (! $this->isConnected()) { |
|
| 32 | + if (!$this->isConnected()) { |
|
| 33 | 33 | return $this->connect(); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function getLastErrorNo() |
| 59 | 59 | { |
| 60 | - $out = (string)$this->getConnect()->sqlstate; |
|
| 60 | + $out = (string) $this->getConnect()->sqlstate; |
|
| 61 | 61 | |
| 62 | 62 | if ($out === '00000') { |
| 63 | 63 | $out = ''; |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | /** |
| 254 | 254 | * {@inheritDoc} |
| 255 | 255 | */ |
| 256 | - public function begin ($flag = 0, $name = null) |
|
| 256 | + public function begin($flag = 0, $name = null) |
|
| 257 | 257 | { |
| 258 | 258 | return $this->getConnect()->begin_transaction($flag, $name); |
| 259 | 259 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | /** |
| 262 | 262 | * {@inheritDoc} |
| 263 | 263 | */ |
| 264 | - public function commit ($flag = 0, $name = null) |
|
| 264 | + public function commit($flag = 0, $name = null) |
|
| 265 | 265 | { |
| 266 | 266 | return $this->getConnect()->commit($flag, $name); |
| 267 | 267 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | /** |
| 270 | 270 | * {@inheritDoc} |
| 271 | 271 | */ |
| 272 | - public function rollback ($flag = 0, $name = null) |
|
| 272 | + public function rollback($flag = 0, $name = null) |
|
| 273 | 273 | { |
| 274 | 274 | return $this->getConnect()->rollback($flag, $name); |
| 275 | 275 | } |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function getConnect() |
| 116 | 116 | { |
| 117 | - if (! $this->isConnected()) { |
|
| 117 | + if (!$this->isConnected()) { |
|
| 118 | 118 | $this->connect(); |
| 119 | - if (! $this->conn->getPdo() instanceof PDO) { |
|
| 119 | + if (!$this->conn->getPdo() instanceof PDO) { |
|
| 120 | 120 | $this->conn->reconnect(); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | public function connect() |
| 158 | 158 | { |
| 159 | 159 | try { |
| 160 | - if (! $this->hasConnectionName($this->connection)) { |
|
| 160 | + if (!$this->hasConnectionName($this->connection)) { |
|
| 161 | 161 | $this->getCapsule()->addConnection([ |
| 162 | 162 | 'driver' => $this->driver, |
| 163 | 163 | 'host' => $this->getConfig('host'), |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | $query = $method . ' ' . $charset; |
| 235 | 235 | |
| 236 | - return (bool)$this->query($query); |
|
| 236 | + return (bool) $this->query($query); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | $result = $this->prepare($sql); |
| 271 | 271 | $this->execute($result); |
| 272 | 272 | |
| 273 | - if ($this->saveAffectedRows($result) === 0 && $this->isResult($result) && ! $this->isSelectQuery($sql)) { |
|
| 273 | + if ($this->saveAffectedRows($result) === 0 && $this->isResult($result) && !$this->isSelectQuery($sql)) { |
|
| 274 | 274 | $result = true; |
| 275 | 275 | } |
| 276 | 276 | $this->getConnect()->logQuery($sql, [], $this->getElapsedTime($start)); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | */ |
| 386 | 386 | public function execute($result) |
| 387 | 387 | { |
| 388 | - return $this->isResult($result) ? $result->execute() : (bool)$result; |
|
| 388 | + return $this->isResult($result) ? $result->execute() : (bool) $result; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | /** |
| 445 | 445 | * {@inheritDoc} |
| 446 | 446 | */ |
| 447 | - public function begin ($flag = 0, $name = null) |
|
| 447 | + public function begin($flag = 0, $name = null) |
|
| 448 | 448 | { |
| 449 | 449 | return $this->getConnect()->getPdo()->beginTransaction(); |
| 450 | 450 | } |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | /** |
| 453 | 453 | * {@inheritDoc} |
| 454 | 454 | */ |
| 455 | - public function commit ($flag = 0, $name = null) |
|
| 455 | + public function commit($flag = 0, $name = null) |
|
| 456 | 456 | { |
| 457 | 457 | return $this->getConnect()->getPdo()->commit(); |
| 458 | 458 | } |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | /** |
| 461 | 461 | * {@inheritDoc} |
| 462 | 462 | */ |
| 463 | - public function rollback ($flag = 0, $name = null) |
|
| 463 | + public function rollback($flag = 0, $name = null) |
|
| 464 | 464 | { |
| 465 | 465 | return $this->getConnect()->getPdo()->rollback(); |
| 466 | 466 | } |