@@ -50,16 +50,14 @@ |
||
| 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 $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)) { |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class HavingExpression |
| 51 | 51 | * @package Platine\Database\Query |
| 52 | 52 | */ |
| 53 | -class HavingExpression |
|
| 54 | -{ |
|
| 53 | +class HavingExpression { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * The Query statement instance |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | * HavingExpression constructor. |
| 80 | 79 | * @param QueryStatement $queryStatement |
| 81 | 80 | */ |
| 82 | - public function __construct(QueryStatement $queryStatement) |
|
| 83 | - { |
|
| 81 | + public function __construct(QueryStatement $queryStatement) { |
|
| 84 | 82 | $this->queryStatement = $queryStatement; |
| 85 | 83 | |
| 86 | 84 | $this->having = new Having($queryStatement); |
@@ -160,8 +158,7 @@ discard block |
||
| 160 | 158 | /** |
| 161 | 159 | * @inheritDoc |
| 162 | 160 | */ |
| 163 | - public function __clone() |
|
| 164 | - { |
|
| 161 | + public function __clone() { |
|
| 165 | 162 | if ($this->column instanceof Expression) { |
| 166 | 163 | $this->column = clone $this->column; |
| 167 | 164 | } |
@@ -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 $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)) { |
@@ -52,8 +52,7 @@ |
||
| 52 | 52 | * Class Expression |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class Expression |
|
| 56 | -{ |
|
| 55 | +class Expression { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * The list of expression |
@@ -125,11 +125,11 @@ |
||
| 125 | 125 | |
| 126 | 126 | foreach ($columns as $k => $v) { |
| 127 | 127 | if (is_numeric($k)) { |
| 128 | - $values[$k] = function (Expression $expr) use ($sign, $v, $value) { |
|
| 128 | + $values[$k] = function(Expression $expr) use ($sign, $v, $value) { |
|
| 129 | 129 | $expr->column($v)->op($sign)->value($value); |
| 130 | 130 | }; |
| 131 | 131 | } else { |
| 132 | - $values[$k] = function (Expression $expr) use ($sign, $k, $v) { |
|
| 132 | + $values[$k] = function(Expression $expr) use ($sign, $k, $v) { |
|
| 133 | 133 | $expr->column($k)->op($sign)->value($v); |
| 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 | /** |
| 59 | 58 | * @var Connection |
@@ -66,8 +65,7 @@ discard block |
||
| 66 | 65 | * @param string|array $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 | } |
@@ -106,8 +104,7 @@ discard block |
||
| 106 | 104 | /** |
| 107 | 105 | * @inheritDoc |
| 108 | 106 | */ |
| 109 | - public function __clone() |
|
| 110 | - { |
|
| 107 | + public function __clone() { |
|
| 111 | 108 | $this->queryStatement = clone $this->queryStatement; |
| 112 | 109 | } |
| 113 | 110 | } |
@@ -287,7 +287,7 @@ |
||
| 287 | 287 | protected function addCondition($value, string $operator, bool $isColumn = false): WhereStatement |
| 288 | 288 | { |
| 289 | 289 | if ($isColumn && is_string($value)) { |
| 290 | - $value = function (Expression $expr) use ($value) { |
|
| 290 | + $value = function(Expression $expr) use ($value) { |
|
| 291 | 291 | return $expr->column($value); |
| 292 | 292 | }; |
| 293 | 293 | } |
@@ -50,8 +50,7 @@ discard block |
||
| 50 | 50 | * Class Where |
| 51 | 51 | * @package Platine\Database\Query |
| 52 | 52 | */ |
| 53 | -class Where |
|
| 54 | -{ |
|
| 53 | +class Where { |
|
| 55 | 54 | |
| 56 | 55 | /** |
| 57 | 56 | * @var string|Expression |
@@ -269,8 +268,7 @@ discard block |
||
| 269 | 268 | /** |
| 270 | 269 | * @inheritDoc |
| 271 | 270 | */ |
| 272 | - public function __clone() |
|
| 273 | - { |
|
| 271 | + public function __clone() { |
|
| 274 | 272 | if ($this->column instanceof Expression) { |
| 275 | 273 | $this->column = clone $this->column; |
| 276 | 274 | } |
@@ -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 |
@@ -632,8 +631,7 @@ discard block |
||
| 632 | 631 | * |
| 633 | 632 | * @return mixed|Expression |
| 634 | 633 | */ |
| 635 | - protected function closureToExpression($value) |
|
| 636 | - { |
|
| 634 | + protected function closureToExpression($value) { |
|
| 637 | 635 | if ($value instanceof Closure) { |
| 638 | 636 | return Expression::fromClosure($value); |
| 639 | 637 | } |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * Class Insert |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class Insert extends InsertStatement |
|
| 56 | -{ |
|
| 55 | +class Insert extends InsertStatement { |
|
| 57 | 56 | |
| 58 | 57 | /** |
| 59 | 58 | * @var Connection |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * @param Connection $connection |
| 66 | 65 | * @param QueryStatement|null $queryStatement |
| 67 | 66 | */ |
| 68 | - public function __construct(Connection $connection, QueryStatement $queryStatement = null) |
|
| 69 | - { |
|
| 67 | + public function __construct(Connection $connection, QueryStatement $queryStatement = null) { |
|
| 70 | 68 | parent::__construct($queryStatement); |
| 71 | 69 | |
| 72 | 70 | $this->connection = $connection; |