@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class ConnectionException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class ConnectionException extends Exception |
|
| 42 | -{ |
|
| 41 | +class ConnectionException extends Exception { |
|
| 43 | 42 | } |
@@ -50,16 +50,14 @@ discard block |
||
| 50 | 50 | * Class DeleteStatement |
| 51 | 51 | * @package Platine\Database\Query |
| 52 | 52 | */ |
| 53 | -class DeleteStatement extends BaseStatement |
|
| 54 | -{ |
|
| 53 | +class DeleteStatement extends BaseStatement { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * DeleteStatement constructor. |
| 58 | 57 | * @param string|array<string> $from |
| 59 | 58 | * @param QueryStatement|null $queryStatement |
| 60 | 59 | */ |
| 61 | - public function __construct($from, QueryStatement $queryStatement = null) |
|
| 62 | - { |
|
| 60 | + public function __construct($from, QueryStatement $queryStatement = null) { |
|
| 63 | 61 | parent::__construct($queryStatement); |
| 64 | 62 | |
| 65 | 63 | if (!is_array($from)) { |
@@ -73,8 +71,7 @@ discard block |
||
| 73 | 71 | * @param string|array<string> $tables |
| 74 | 72 | * @return mixed |
| 75 | 73 | */ |
| 76 | - public function delete($tables = []) |
|
| 77 | - { |
|
| 74 | + public function delete($tables = []) { |
|
| 78 | 75 | if (!is_array($tables)) { |
| 79 | 76 | /** @var array<string> $tables */ |
| 80 | 77 | $tables = [$tables]; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | !empty($config['connections']) |
| 79 | 79 | && is_array($config['connections']) |
| 80 | 80 | ) { |
| 81 | - /** @var array<string, array<string, mixed>> $connections */ |
|
| 81 | + /** @var array<string, array<string, mixed>> $connections */ |
|
| 82 | 82 | $connections = $config['connections']; |
| 83 | 83 | |
| 84 | 84 | foreach ($connections as $name => $connection) { |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * Class Pool |
| 54 | 54 | * @package Platine\Database |
| 55 | 55 | */ |
| 56 | -class Pool |
|
| 57 | -{ |
|
| 56 | +class Pool { |
|
| 58 | 57 | /** |
| 59 | 58 | * The default connection name |
| 60 | 59 | * @var string |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * Class constructor |
| 72 | 71 | * @param array<string, mixed> $config |
| 73 | 72 | */ |
| 74 | - public function __construct(array $config = []) |
|
| 75 | - { |
|
| 73 | + public function __construct(array $config = []) { |
|
| 76 | 74 | if (!empty($config)) { |
| 77 | 75 | if ( |
| 78 | 76 | !empty($config['connections']) |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class ConnectionNotFoundException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class ConnectionNotFoundException extends Exception |
|
| 42 | -{ |
|
| 41 | +class ConnectionNotFoundException extends Exception { |
|
| 43 | 42 | } |
@@ -38,6 +38,5 @@ |
||
| 38 | 38 | * Class ConnectionAlreadyExistsException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class ConnectionAlreadyExistsException extends Exception |
|
| 42 | -{ |
|
| 41 | +class ConnectionAlreadyExistsException extends Exception { |
|
| 43 | 42 | } |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Class QueryException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class QueryException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class QueryException extends RuntimeException { |
|
| 43 | 42 | |
| 44 | 43 | } |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Class QueryPrepareException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class QueryPrepareException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class QueryPrepareException extends RuntimeException { |
|
| 43 | 42 | |
| 44 | 43 | } |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Class TransactionException |
| 39 | 39 | * @package Platine\Database\Exception |
| 40 | 40 | */ |
| 41 | -class TransactionException extends RuntimeException |
|
| 42 | -{ |
|
| 41 | +class TransactionException extends RuntimeException { |
|
| 43 | 42 | |
| 44 | 43 | } |
@@ -421,12 +421,12 @@ |
||
| 421 | 421 | $this->createPDO(); |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | - /** |
|
| 425 | - * Change the query parameters placeholder with the value |
|
| 426 | - * @param string $query |
|
| 427 | - * @param array<int, mixed> $params |
|
| 428 | - * @return string |
|
| 429 | - */ |
|
| 424 | + /** |
|
| 425 | + * Change the query parameters placeholder with the value |
|
| 426 | + * @param string $query |
|
| 427 | + * @param array<int, mixed> $params |
|
| 428 | + * @return string |
|
| 429 | + */ |
|
| 430 | 430 | protected function replaceParameters(string $query, array $params): string |
| 431 | 431 | { |
| 432 | 432 | $driver = $this->driver; |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | * Class Connection |
| 62 | 62 | * @package Platine\Database |
| 63 | 63 | */ |
| 64 | -class Connection |
|
| 65 | -{ |
|
| 64 | +class Connection { |
|
| 66 | 65 | /** |
| 67 | 66 | * The PDO instance |
| 68 | 67 | * @var PDO |
@@ -346,8 +345,7 @@ discard block |
||
| 346 | 345 | * @return mixed |
| 347 | 346 | * @throws QueryException |
| 348 | 347 | */ |
| 349 | - public function column(string $sql, array $params = []) |
|
| 350 | - { |
|
| 348 | + public function column(string $sql, array $params = []) { |
|
| 351 | 349 | $prepared = $this->prepare($sql, $params); |
| 352 | 350 | $this->execute($prepared); |
| 353 | 351 | |
@@ -400,8 +398,7 @@ discard block |
||
| 400 | 398 | /** |
| 401 | 399 | * {@inheritdoc} |
| 402 | 400 | */ |
| 403 | - public function __sleep() |
|
| 404 | - { |
|
| 401 | + public function __sleep() { |
|
| 405 | 402 | return [ |
| 406 | 403 | 'dsn', |
| 407 | 404 | 'driver', |
@@ -415,8 +412,7 @@ discard block |
||
| 415 | 412 | /** |
| 416 | 413 | * {@inheritdoc} |
| 417 | 414 | */ |
| 418 | - public function __wakeup() |
|
| 419 | - { |
|
| 415 | + public function __wakeup() { |
|
| 420 | 416 | $this->createPDO(); |
| 421 | 417 | } |
| 422 | 418 | |