@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class ForeignKey |
| 51 | 51 | * @package Platine\Database\Schema |
| 52 | 52 | */ |
| 53 | -class ForeignKey |
|
| 54 | -{ |
|
| 53 | +class ForeignKey { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The referenced table |
@@ -81,8 +80,7 @@ discard block |
||
| 81 | 80 | * Class constructor |
| 82 | 81 | * @param array<int, string> $columns |
| 83 | 82 | */ |
| 84 | - public function __construct(array $columns) |
|
| 85 | - { |
|
| 83 | + public function __construct(array $columns) { |
|
| 86 | 84 | $this->columns = $columns; |
| 87 | 85 | } |
| 88 | 86 | |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * Class Configuration |
| 59 | 59 | * @package Platine\Database |
| 60 | 60 | */ |
| 61 | -class Configuration implements ConfigurationInterface |
|
| 62 | -{ |
|
| 61 | +class Configuration implements ConfigurationInterface { |
|
| 63 | 62 | /** |
| 64 | 63 | * The connection driver to use |
| 65 | 64 | * @var string |
@@ -159,8 +158,7 @@ discard block |
||
| 159 | 158 | * Class constructor |
| 160 | 159 | * @param array<string, mixed> $config the connection configuration |
| 161 | 160 | */ |
| 162 | - public function __construct(array $config = []) |
|
| 163 | - { |
|
| 161 | + public function __construct(array $config = []) { |
|
| 164 | 162 | $this->load($config); |
| 165 | 163 | } |
| 166 | 164 | |
@@ -291,8 +289,7 @@ discard block |
||
| 291 | 289 | /** |
| 292 | 290 | * {@inheritedoc} |
| 293 | 291 | */ |
| 294 | - public function getAttribute(string $name, $default = null) |
|
| 295 | - { |
|
| 292 | + public function getAttribute(string $name, $default = null) { |
|
| 296 | 293 | return $this->hasAttribute($name) |
| 297 | 294 | ? $this->attributes[$name] |
| 298 | 295 | : $default; |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | * Interface ConfigurationInterface |
| 51 | 51 | * @package Platine\Database |
| 52 | 52 | */ |
| 53 | -interface ConfigurationInterface |
|
| 54 | -{ |
|
| 53 | +interface ConfigurationInterface { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class Having |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class Having |
|
| 56 | -{ |
|
| 55 | +class Having { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * @var string|Expression |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | * Having constructor. |
| 76 | 75 | * @param QueryStatement $queryStatement |
| 77 | 76 | */ |
| 78 | - public function __construct(QueryStatement $queryStatement) |
|
| 79 | - { |
|
| 77 | + public function __construct(QueryStatement $queryStatement) { |
|
| 80 | 78 | $this->queryStatement = $queryStatement; |
| 81 | 79 | } |
| 82 | 80 | |
@@ -227,8 +225,7 @@ discard block |
||
| 227 | 225 | /** |
| 228 | 226 | * @inheritDoc |
| 229 | 227 | */ |
| 230 | - public function __clone() |
|
| 231 | - { |
|
| 228 | + public function __clone() { |
|
| 232 | 229 | if ($this->aggregate instanceof Expression) { |
| 233 | 230 | $this->aggregate = clone $this->aggregate; |
| 234 | 231 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * Class Delete |
| 54 | 54 | * @package Platine\Database\Query |
| 55 | 55 | */ |
| 56 | -class Delete extends DeleteStatement |
|
| 57 | -{ |
|
| 56 | +class Delete extends DeleteStatement { |
|
| 58 | 57 | |
| 59 | 58 | /** |
| 60 | 59 | * @var Connection |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | * @param string|array<string> $from |
| 68 | 67 | * @param QueryStatement|null $queryStatement |
| 69 | 68 | */ |
| 70 | - public function __construct(Connection $connection, $from, QueryStatement $queryStatement = null) |
|
| 71 | - { |
|
| 69 | + public function __construct(Connection $connection, $from, QueryStatement $queryStatement = null) { |
|
| 72 | 70 | parent::__construct($from, $queryStatement); |
| 73 | 71 | |
| 74 | 72 | $this->connection = $connection; |
@@ -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 | /** |
| 59 | 58 | * @var Connection |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * @param string|array<int, string> $table |
| 67 | 66 | * @param QueryStatement|null $queryStatement |
| 68 | 67 | */ |
| 69 | - public function __construct(Connection $connection, $table, QueryStatement $queryStatement = null) |
|
| 70 | - { |
|
| 68 | + public function __construct(Connection $connection, $table, QueryStatement $queryStatement = null) { |
|
| 71 | 69 | parent::__construct($table, $queryStatement); |
| 72 | 70 | |
| 73 | 71 | $this->connection = $connection; |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class InsertStatement |
| 51 | 51 | * @package Platine\Database\Query |
| 52 | 52 | */ |
| 53 | -class InsertStatement |
|
| 54 | -{ |
|
| 53 | +class InsertStatement { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The Query statement instance |
@@ -63,8 +62,7 @@ discard block |
||
| 63 | 62 | * InsertStatement constructor. |
| 64 | 63 | * @param QueryStatement|null $queryStatement |
| 65 | 64 | */ |
| 66 | - public function __construct(QueryStatement $queryStatement = null) |
|
| 67 | - { |
|
| 65 | + public function __construct(QueryStatement $queryStatement = null) { |
|
| 68 | 66 | if ($queryStatement === null) { |
| 69 | 67 | $queryStatement = new QueryStatement(); |
| 70 | 68 | } |
@@ -99,16 +97,14 @@ discard block |
||
| 99 | 97 | * @param string $table |
| 100 | 98 | * @return mixed |
| 101 | 99 | */ |
| 102 | - public function into(string $table) |
|
| 103 | - { |
|
| 100 | + public function into(string $table) { |
|
| 104 | 101 | $this->queryStatement->addTables([$table]); |
| 105 | 102 | } |
| 106 | 103 | |
| 107 | 104 | /** |
| 108 | 105 | * @inheritDoc |
| 109 | 106 | */ |
| 110 | - public function __clone() |
|
| 111 | - { |
|
| 107 | + public function __clone() { |
|
| 112 | 108 | $this->queryStatement = clone $this->queryStatement; |
| 113 | 109 | } |
| 114 | 110 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @package Platine\Database\Query |
| 55 | 55 | */ |
| 56 | -class QueryStatement |
|
| 57 | -{ |
|
| 56 | +class QueryStatement { |
|
| 58 | 57 | |
| 59 | 58 | /** |
| 60 | 59 | * The where SQL parts |
@@ -349,8 +348,7 @@ discard block |
||
| 349 | 348 | * @param bool $not |
| 350 | 349 | * @return mixed |
| 351 | 350 | */ |
| 352 | - public function addHavingIn($aggregate, $value, string $separator, bool $not) |
|
| 353 | - { |
|
| 351 | + public function addHavingIn($aggregate, $value, string $separator, bool $not) { |
|
| 354 | 352 | $aggregate = $this->closureToExpression($aggregate); |
| 355 | 353 | |
| 356 | 354 | if ($value instanceof Closure) { |
@@ -618,8 +616,7 @@ discard block |
||
| 618 | 616 | * |
| 619 | 617 | * @return mixed|Expression |
| 620 | 618 | */ |
| 621 | - protected function closureToExpression($value) |
|
| 622 | - { |
|
| 619 | + protected function closureToExpression($value) { |
|
| 623 | 620 | if ($value instanceof Closure) { |
| 624 | 621 | return Expression::fromClosure($value); |
| 625 | 622 | } |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class UpdateStatement |
| 51 | 51 | * @package Platine\Database\Query |
| 52 | 52 | */ |
| 53 | -class UpdateStatement extends BaseStatement |
|
| 54 | -{ |
|
| 53 | +class UpdateStatement extends BaseStatement { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The Query statement instance |
@@ -64,8 +63,7 @@ discard block |
||
| 64 | 63 | * @param string|array<int, string> $table |
| 65 | 64 | * @param QueryStatement|null $queryStatement |
| 66 | 65 | */ |
| 67 | - public function __construct($table, QueryStatement $queryStatement = null) |
|
| 68 | - { |
|
| 66 | + public function __construct($table, QueryStatement $queryStatement = null) { |
|
| 69 | 67 | parent::__construct($queryStatement); |
| 70 | 68 | |
| 71 | 69 | if (!is_array($table)) { |
@@ -80,8 +78,7 @@ discard block |
||
| 80 | 78 | * |
| 81 | 79 | * @return void |
| 82 | 80 | */ |
| 83 | - public function set(array $columns) |
|
| 84 | - { |
|
| 81 | + public function set(array $columns) { |
|
| 85 | 82 | $this->queryStatement->addUpdateColumns($columns); |
| 86 | 83 | } |
| 87 | 84 | } |