@@ -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]; |
@@ -292,7 +292,7 @@ |
||
| 292 | 292 | bool $isColumn = false |
| 293 | 293 | ): WhereStatement { |
| 294 | 294 | if ($isColumn && is_string($value)) { |
| 295 | - $value = function (Expression $expr) use ($value) { |
|
| 295 | + $value = function(Expression $expr) use ($value) { |
|
| 296 | 296 | return $expr->column($value); |
| 297 | 297 | }; |
| 298 | 298 | } |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class Where |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class Where |
|
| 56 | -{ |
|
| 55 | +class Where { |
|
| 57 | 56 | /** |
| 58 | 57 | * @var string|Expression |
| 59 | 58 | */ |
@@ -270,8 +269,7 @@ discard block |
||
| 270 | 269 | /** |
| 271 | 270 | * @inheritDoc |
| 272 | 271 | */ |
| 273 | - public function __clone() |
|
| 274 | - { |
|
| 272 | + public function __clone() { |
|
| 275 | 273 | if ($this->column instanceof Expression) { |
| 276 | 274 | $this->column = clone $this->column; |
| 277 | 275 | } |
@@ -125,11 +125,11 @@ |
||
| 125 | 125 | |
| 126 | 126 | foreach ($columns as $key => $val) { |
| 127 | 127 | if (is_numeric($key)) { |
| 128 | - $values[$val] = function (Expression $expr) use ($sign, $val, $value) { |
|
| 128 | + $values[$val] = function(Expression $expr) use ($sign, $val, $value) { |
|
| 129 | 129 | $expr->column($val)->op($sign)->value($value); |
| 130 | 130 | }; |
| 131 | 131 | } else { |
| 132 | - $values[$key] = function (Expression $expr) use ($sign, $key, $val) { |
|
| 132 | + $values[$key] = function(Expression $expr) use ($sign, $key, $val) { |
|
| 133 | 133 | $expr->column($key)->op($sign)->value($val); |
| 134 | 134 | }; |
| 135 | 135 | } |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class Update |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class Update extends UpdateStatement |
|
| 56 | -{ |
|
| 55 | +class Update extends UpdateStatement { |
|
| 57 | 56 | /** |
| 58 | 57 | * @var Connection |
| 59 | 58 | */ |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * @param string|array<int, string> $table |
| 66 | 65 | * @param QueryStatement|null $queryStatement |
| 67 | 66 | */ |
| 68 | - public function __construct(Connection $connection, $table, QueryStatement $queryStatement = null) |
|
| 69 | - { |
|
| 67 | + public function __construct(Connection $connection, $table, QueryStatement $queryStatement = null) { |
|
| 70 | 68 | parent::__construct($table, $queryStatement); |
| 71 | 69 | |
| 72 | 70 | $this->connection = $connection; |
@@ -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 | } |