@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class Query |
| 55 | 55 | * @package Platine\Database\Query |
| 56 | 56 | */ |
| 57 | -class Query extends BaseStatement |
|
| 58 | -{ |
|
| 57 | +class Query extends BaseStatement { |
|
| 59 | 58 | /** |
| 60 | 59 | * @var Connection |
| 61 | 60 | */ |
@@ -246,8 +245,7 @@ discard block |
||
| 246 | 245 | * |
| 247 | 246 | * @return mixed |
| 248 | 247 | */ |
| 249 | - public function max(string|Expression|Closure $column, bool $distinct = false) |
|
| 250 | - { |
|
| 248 | + public function max(string|Expression|Closure $column, bool $distinct = false) { |
|
| 251 | 249 | return $this->buildSelect()->max($column, $distinct); |
| 252 | 250 | } |
| 253 | 251 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * @var string|array<string> |
| 66 | 66 | */ |
| 67 | - protected string|array $tables; |
|
| 67 | + protected string | array $tables; |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Query constructor. |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function __construct( |
| 76 | 76 | Connection $connection, |
| 77 | - string|array $tables, |
|
| 77 | + string | array $tables, |
|
| 78 | 78 | ?QueryStatement $queryStatement = null |
| 79 | 79 | ) { |
| 80 | 80 | parent::__construct($queryStatement); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return Select|SelectStatement |
| 90 | 90 | */ |
| 91 | - public function distinct(bool $value = true): Select|SelectStatement |
|
| 91 | + public function distinct(bool $value = true): Select | SelectStatement |
|
| 92 | 92 | { |
| 93 | 93 | return $this->buildSelect()->distinct($value); |
| 94 | 94 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * @return Select|SelectStatement |
| 100 | 100 | */ |
| 101 | - public function groupBy(string|array|Closure|Expression $columns): Select|SelectStatement |
|
| 101 | + public function groupBy(string | array | Closure | Expression $columns): Select | SelectStatement |
|
| 102 | 102 | { |
| 103 | 103 | return $this->buildSelect()->groupBy($columns); |
| 104 | 104 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @return Select|SelectStatement |
| 111 | 111 | */ |
| 112 | - public function having(string|Expression $column, ?Closure $value = null): Select|SelectStatement |
|
| 112 | + public function having(string | Expression $column, ?Closure $value = null): Select | SelectStatement |
|
| 113 | 113 | { |
| 114 | 114 | return $this->buildSelect()->having($column, $value); |
| 115 | 115 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @return Select|SelectStatement |
| 122 | 122 | */ |
| 123 | - public function orHaving(string|Expression $column, ?Closure $value = null): Select|SelectStatement |
|
| 123 | + public function orHaving(string | Expression $column, ?Closure $value = null): Select | SelectStatement |
|
| 124 | 124 | { |
| 125 | 125 | return $this->buildSelect()->orHaving($column, $value); |
| 126 | 126 | } |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | * @return Select|SelectStatement |
| 133 | 133 | */ |
| 134 | 134 | public function orderBy( |
| 135 | - string|array|Closure|Expression $columns, |
|
| 135 | + string | array | Closure | Expression $columns, |
|
| 136 | 136 | string $order = 'ASC' |
| 137 | - ): Select|SelectStatement { |
|
| 137 | + ): Select | SelectStatement { |
|
| 138 | 138 | return $this->buildSelect()->orderBy($columns, $order); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @return Select|SelectStatement |
| 145 | 145 | */ |
| 146 | - public function limit(int $value): Select|SelectStatement |
|
| 146 | + public function limit(int $value): Select | SelectStatement |
|
| 147 | 147 | { |
| 148 | 148 | return $this->buildSelect()->limit($value); |
| 149 | 149 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * |
| 154 | 154 | * @return Select|SelectStatement |
| 155 | 155 | */ |
| 156 | - public function offset(int $value): Select|SelectStatement |
|
| 156 | + public function offset(int $value): Select | SelectStatement |
|
| 157 | 157 | { |
| 158 | 158 | return $this->buildSelect()->offset($value); |
| 159 | 159 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param string $table |
| 163 | 163 | * @return Select|SelectStatement |
| 164 | 164 | */ |
| 165 | - public function into(string $table): Select|SelectStatement |
|
| 165 | + public function into(string $table): Select | SelectStatement |
|
| 166 | 166 | { |
| 167 | 167 | return $this->buildSelect()->into($table); |
| 168 | 168 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @return ResultSet |
| 174 | 174 | */ |
| 175 | - public function select(string|array|Expression|Closure $columns = []): ResultSet |
|
| 175 | + public function select(string | array | Expression | Closure $columns = []): ResultSet |
|
| 176 | 176 | { |
| 177 | 177 | return $this->buildSelect()->select($columns); |
| 178 | 178 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * @param string|array<string> $tables |
| 182 | 182 | * @return int |
| 183 | 183 | */ |
| 184 | - public function delete(string|array $tables): int |
|
| 184 | + public function delete(string | array $tables): int |
|
| 185 | 185 | { |
| 186 | 186 | return $this->buildDelete()->delete($tables); |
| 187 | 187 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * |
| 192 | 192 | * @return mixed |
| 193 | 193 | */ |
| 194 | - public function column(string|Closure|Expression $name): mixed |
|
| 194 | + public function column(string | Closure | Expression $name): mixed |
|
| 195 | 195 | { |
| 196 | 196 | return $this->buildSelect()->column($name); |
| 197 | 197 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * |
| 203 | 203 | * @return int |
| 204 | 204 | */ |
| 205 | - public function count(string|Expression|Closure $column = '*', bool $distinct = false): int |
|
| 205 | + public function count(string | Expression | Closure $column = '*', bool $distinct = false): int |
|
| 206 | 206 | { |
| 207 | 207 | return $this->buildSelect()->count($column, $distinct); |
| 208 | 208 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * |
| 214 | 214 | * @return int|float |
| 215 | 215 | */ |
| 216 | - public function avg(string|Expression|Closure $column, bool $distinct = false): int|float |
|
| 216 | + public function avg(string | Expression | Closure $column, bool $distinct = false): int | float |
|
| 217 | 217 | { |
| 218 | 218 | return $this->buildSelect()->avg($column, $distinct); |
| 219 | 219 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * |
| 225 | 225 | * @return int|float |
| 226 | 226 | */ |
| 227 | - public function sum(string|Expression|Closure $column, bool $distinct = false): int|float |
|
| 227 | + public function sum(string | Expression | Closure $column, bool $distinct = false): int | float |
|
| 228 | 228 | { |
| 229 | 229 | return $this->buildSelect()->sum($column, $distinct); |
| 230 | 230 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * |
| 236 | 236 | * @return mixed |
| 237 | 237 | */ |
| 238 | - public function min(string|Expression|Closure $column, bool $distinct = false): mixed |
|
| 238 | + public function min(string | Expression | Closure $column, bool $distinct = false): mixed |
|
| 239 | 239 | { |
| 240 | 240 | return $this->buildSelect()->min($column, $distinct); |
| 241 | 241 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | * |
| 247 | 247 | * @return mixed |
| 248 | 248 | */ |
| 249 | - public function max(string|Expression|Closure $column, bool $distinct = false) |
|
| 249 | + public function max(string | Expression | Closure $column, bool $distinct = false) |
|
| 250 | 250 | { |
| 251 | 251 | return $this->buildSelect()->max($column, $distinct); |
| 252 | 252 | } |
@@ -52,8 +52,7 @@ |
||
| 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 | */ |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @var string|Expression |
| 59 | 59 | */ |
| 60 | - protected string|Expression $column; |
|
| 60 | + protected string | Expression $column; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @var string |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @param string $separator |
| 81 | 81 | * @return $this |
| 82 | 82 | */ |
| 83 | - public function init(string|Expression|Closure $column, string $separator): self |
|
| 83 | + public function init(string | Expression | Closure $column, string $separator): self |
|
| 84 | 84 | { |
| 85 | 85 | if ($column instanceof Closure) { |
| 86 | 86 | $column = Expression::fromClosure($column); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param bool $isColumn |
| 97 | 97 | * @return WhereStatement|Select|Delete|Update |
| 98 | 98 | */ |
| 99 | - public function is(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 99 | + public function is(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 100 | 100 | { |
| 101 | 101 | return $this->addCondition($value, '=', $isColumn); |
| 102 | 102 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @param bool $isColumn |
| 107 | 107 | * @return WhereStatement|Select|Delete|Update |
| 108 | 108 | */ |
| 109 | - public function eq(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 109 | + public function eq(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 110 | 110 | { |
| 111 | 111 | return $this->is($value, $isColumn); |
| 112 | 112 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @param bool $isColumn |
| 117 | 117 | * @return WhereStatement|Select|Delete|Update |
| 118 | 118 | */ |
| 119 | - public function isNot(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 119 | + public function isNot(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 120 | 120 | { |
| 121 | 121 | return $this->addCondition($value, '!=', $isColumn); |
| 122 | 122 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param bool $isColumn |
| 127 | 127 | * @return WhereStatement|Select|Delete|Update |
| 128 | 128 | */ |
| 129 | - public function neq(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 129 | + public function neq(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 130 | 130 | { |
| 131 | 131 | return $this->isNot($value, $isColumn); |
| 132 | 132 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * @param bool $isColumn |
| 137 | 137 | * @return WhereStatement|Select|Delete|Update |
| 138 | 138 | */ |
| 139 | - public function lt(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 139 | + public function lt(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 140 | 140 | { |
| 141 | 141 | return $this->addCondition($value, '<', $isColumn); |
| 142 | 142 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @param bool $isColumn |
| 147 | 147 | * @return WhereStatement|Select|Delete|Update |
| 148 | 148 | */ |
| 149 | - public function gt(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 149 | + public function gt(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 150 | 150 | { |
| 151 | 151 | return $this->addCondition($value, '>', $isColumn); |
| 152 | 152 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @param bool $isColumn |
| 157 | 157 | * @return WhereStatement|Select|Delete|Update |
| 158 | 158 | */ |
| 159 | - public function lte(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 159 | + public function lte(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 160 | 160 | { |
| 161 | 161 | return $this->addCondition($value, '<=', $isColumn); |
| 162 | 162 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * @param bool $isColumn |
| 167 | 167 | * @return WhereStatement|Select|Delete|Update |
| 168 | 168 | */ |
| 169 | - public function gte(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
| 169 | + public function gte(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
| 170 | 170 | { |
| 171 | 171 | return $this->addCondition($value, '>=', $isColumn); |
| 172 | 172 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * @param mixed $value2 |
| 177 | 177 | * @return WhereStatement|Select|Delete|Update |
| 178 | 178 | */ |
| 179 | - public function between(mixed $value1, mixed $value2): WhereStatement|Select|Delete|Update |
|
| 179 | + public function between(mixed $value1, mixed $value2): WhereStatement | Select | Delete | Update |
|
| 180 | 180 | { |
| 181 | 181 | return $this->addBetweenCondition($value1, $value2, false); |
| 182 | 182 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @param mixed $value2 |
| 187 | 187 | * @return WhereStatement|Select|Delete|Update |
| 188 | 188 | */ |
| 189 | - public function notBetween(mixed $value1, mixed $value2): WhereStatement|Select|Delete|Update |
|
| 189 | + public function notBetween(mixed $value1, mixed $value2): WhereStatement | Select | Delete | Update |
|
| 190 | 190 | { |
| 191 | 191 | return $this->addBetweenCondition($value1, $value2, true); |
| 192 | 192 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param mixed $value |
| 196 | 196 | * @return WhereStatement|Select|Delete|Update |
| 197 | 197 | */ |
| 198 | - public function like(mixed $value): WhereStatement|Select|Delete|Update |
|
| 198 | + public function like(mixed $value): WhereStatement | Select | Delete | Update |
|
| 199 | 199 | { |
| 200 | 200 | return $this->addLikeCondition($value, false); |
| 201 | 201 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param mixed $value |
| 205 | 205 | * @return WhereStatement|Select|Delete|Update |
| 206 | 206 | */ |
| 207 | - public function notLike(mixed $value): WhereStatement|Select|Delete|Update |
|
| 207 | + public function notLike(mixed $value): WhereStatement | Select | Delete | Update |
|
| 208 | 208 | { |
| 209 | 209 | return $this->addLikeCondition($value, true); |
| 210 | 210 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @param array<int, mixed>|Closure $value |
| 214 | 214 | * @return WhereStatement |
| 215 | 215 | */ |
| 216 | - public function in(array|Closure $value): WhereStatement |
|
| 216 | + public function in(array | Closure $value): WhereStatement |
|
| 217 | 217 | { |
| 218 | 218 | return $this->addInCondition($value, false); |
| 219 | 219 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @param array<int, mixed>|Closure $value |
| 223 | 223 | * @return WhereStatement |
| 224 | 224 | */ |
| 225 | - public function notIn(array|Closure $value): WhereStatement |
|
| 225 | + public function notIn(array | Closure $value): WhereStatement |
|
| 226 | 226 | { |
| 227 | 227 | return $this->addInCondition($value, true); |
| 228 | 228 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | /** |
| 231 | 231 | * @return WhereStatement|Select|Delete|Update |
| 232 | 232 | */ |
| 233 | - public function isNull(): WhereStatement|Select|Delete|Update |
|
| 233 | + public function isNull(): WhereStatement | Select | Delete | Update |
|
| 234 | 234 | { |
| 235 | 235 | return $this->addNullCondition(false); |
| 236 | 236 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | /** |
| 239 | 239 | * @return WhereStatement|Select|Delete|Update |
| 240 | 240 | */ |
| 241 | - public function isNotNull(): WhereStatement|Select|Delete|Update |
|
| 241 | + public function isNotNull(): WhereStatement | Select | Delete | Update |
|
| 242 | 242 | { |
| 243 | 243 | return $this->addNullCondition(true); |
| 244 | 244 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | /** |
| 247 | 247 | * @return WhereStatement|Select|Delete|Update |
| 248 | 248 | */ |
| 249 | - public function nop(): WhereStatement|Select|Delete|Update |
|
| 249 | + public function nop(): WhereStatement | Select | Delete | Update |
|
| 250 | 250 | { |
| 251 | 251 | $this->queryStatement->addWhereNop($this->column, $this->separator); |
| 252 | 252 | |
@@ -275,9 +275,9 @@ discard block |
||
| 275 | 275 | mixed $value, |
| 276 | 276 | string $operator, |
| 277 | 277 | bool $isColumn = false |
| 278 | - ): WhereStatement|Select|Delete|Update { |
|
| 278 | + ): WhereStatement | Select | Delete | Update { |
|
| 279 | 279 | if ($isColumn && is_string($value)) { |
| 280 | - $value = function (Expression $expr) use ($value) { |
|
| 280 | + $value = function(Expression $expr) use ($value) { |
|
| 281 | 281 | return $expr->column($value); |
| 282 | 282 | }; |
| 283 | 283 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | mixed $value1, |
| 302 | 302 | mixed $value2, |
| 303 | 303 | bool $not |
| 304 | - ): WhereStatement|Select|Delete|update { |
|
| 304 | + ): WhereStatement | Select | Delete | update { |
|
| 305 | 305 | $this->queryStatement->addWhereBetween( |
| 306 | 306 | $this->column, |
| 307 | 307 | $value1, |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * @param bool $not |
| 319 | 319 | * @return WhereStatement|Select|Delete|update |
| 320 | 320 | */ |
| 321 | - protected function addLikeCondition(string $pattern, bool $not): WhereStatement|Select|Delete|update |
|
| 321 | + protected function addLikeCondition(string $pattern, bool $not): WhereStatement | Select | Delete | update |
|
| 322 | 322 | { |
| 323 | 323 | $this->queryStatement->addWhereLike( |
| 324 | 324 | $this->column, |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * @param bool $not |
| 336 | 336 | * @return WhereStatement|Select|Delete|update |
| 337 | 337 | */ |
| 338 | - protected function addInCondition(mixed $value, bool $not): WhereStatement|Select|Delete|update |
|
| 338 | + protected function addInCondition(mixed $value, bool $not): WhereStatement | Select | Delete | update |
|
| 339 | 339 | { |
| 340 | 340 | $this->queryStatement->addWhereIn( |
| 341 | 341 | $this->column, |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | * @param bool $not |
| 352 | 352 | * @return WhereStatement|Select|Delete|Update |
| 353 | 353 | */ |
| 354 | - protected function addNullCondition(bool $not): WhereStatement|Select|Delete|Update |
|
| 354 | + protected function addNullCondition(bool $not): WhereStatement | Select | Delete | Update |
|
| 355 | 355 | { |
| 356 | 356 | $this->queryStatement->addWhereNull( |
| 357 | 357 | $this->column, |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class Select |
| 55 | 55 | * @package Platine\Database\Query |
| 56 | 56 | */ |
| 57 | -class Select extends SelectStatement |
|
| 58 | -{ |
|
| 57 | +class Select extends SelectStatement { |
|
| 59 | 58 | /** |
| 60 | 59 | * @var Connection |
| 61 | 60 | */ |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function __construct( |
| 71 | 71 | Connection $connection, |
| 72 | - string|array $tables, |
|
| 72 | + string | array $tables, |
|
| 73 | 73 | ?QueryStatement $queryStatement = null |
| 74 | 74 | ) { |
| 75 | 75 | parent::__construct($tables, $queryStatement); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @return ResultSet |
| 83 | 83 | */ |
| 84 | - public function select(string|Expression|Closure|array $columns = []): ResultSet |
|
| 84 | + public function select(string | Expression | Closure | array $columns = []): ResultSet |
|
| 85 | 85 | { |
| 86 | 86 | parent::select($columns); |
| 87 | 87 | $driver = $this->connection->getDriver(); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return mixed |
| 99 | 99 | */ |
| 100 | - public function column(string|Expression|Closure $name): mixed |
|
| 100 | + public function column(string | Expression | Closure $name): mixed |
|
| 101 | 101 | { |
| 102 | 102 | parent::column($name); |
| 103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @return int |
| 112 | 112 | */ |
| 113 | 113 | public function count( |
| 114 | - string|Expression|Closure $column = '*', |
|
| 114 | + string | Expression | Closure $column = '*', |
|
| 115 | 115 | bool $distinct = false |
| 116 | 116 | ): int { |
| 117 | 117 | parent::count($column, $distinct); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | * @return int|float |
| 126 | 126 | */ |
| 127 | 127 | public function avg( |
| 128 | - string|Expression|Closure $column, |
|
| 128 | + string | Expression | Closure $column, |
|
| 129 | 129 | bool $distinct = false |
| 130 | - ): int|float { |
|
| 130 | + ): int | float { |
|
| 131 | 131 | parent::avg($column, $distinct); |
| 132 | 132 | return $this->getColumnResult(); |
| 133 | 133 | } |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | * @return int|float |
| 140 | 140 | */ |
| 141 | 141 | public function sum( |
| 142 | - string|Expression|Closure $column, |
|
| 142 | + string | Expression | Closure $column, |
|
| 143 | 143 | bool $distinct = false |
| 144 | - ): int|float { |
|
| 144 | + ): int | float { |
|
| 145 | 145 | parent::sum($column, $distinct); |
| 146 | 146 | return $this->getColumnResult(); |
| 147 | 147 | } |
@@ -153,9 +153,9 @@ discard block |
||
| 153 | 153 | * @return int|float |
| 154 | 154 | */ |
| 155 | 155 | public function min( |
| 156 | - string|Expression|Closure $column, |
|
| 156 | + string | Expression | Closure $column, |
|
| 157 | 157 | bool $distinct = false |
| 158 | - ): int|float { |
|
| 158 | + ): int | float { |
|
| 159 | 159 | parent::min($column, $distinct); |
| 160 | 160 | return $this->getColumnResult(); |
| 161 | 161 | } |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | * @return int|float |
| 168 | 168 | */ |
| 169 | 169 | public function max( |
| 170 | - string|Expression|Closure $column, |
|
| 170 | + string | Expression | Closure $column, |
|
| 171 | 171 | bool $distinct = false |
| 172 | - ): int|float { |
|
| 172 | + ): int | float { |
|
| 173 | 173 | parent::max($column, $distinct); |
| 174 | 174 | return $this->getColumnResult(); |
| 175 | 175 | } |
@@ -535,7 +535,7 @@ |
||
| 535 | 535 | * |
| 536 | 536 | * @return string |
| 537 | 537 | */ |
| 538 | - protected function quoteIdentifier(string|Expression $value): string |
|
| 538 | + protected function quoteIdentifier(string | Expression $value): string |
|
| 539 | 539 | { |
| 540 | 540 | if ($value instanceof Expression) { |
| 541 | 541 | return $this->getExpressions($value->getExpressions()); |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | * @class Driver |
| 63 | 63 | * @package Platine\Database\Driver |
| 64 | 64 | */ |
| 65 | -class Driver |
|
| 66 | -{ |
|
| 65 | +class Driver { |
|
| 67 | 66 | /** |
| 68 | 67 | * The driver default date format |
| 69 | 68 | * @var string |
@@ -123,8 +122,7 @@ discard block |
||
| 123 | 122 | * @class constructor |
| 124 | 123 | * @param Connection $connection |
| 125 | 124 | */ |
| 126 | - public function __construct(protected Connection $connection) |
|
| 127 | - { |
|
| 125 | + public function __construct(protected Connection $connection) { |
|
| 128 | 126 | } |
| 129 | 127 | |
| 130 | 128 | /** |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @class Schema |
| 54 | 54 | * @package Platine\Database |
| 55 | 55 | */ |
| 56 | -class Schema |
|
| 57 | -{ |
|
| 56 | +class Schema { |
|
| 58 | 57 | /** |
| 59 | 58 | * The list of tables |
| 60 | 59 | * @var array<string, string> |
@@ -83,8 +82,7 @@ discard block |
||
| 83 | 82 | * Class constructor |
| 84 | 83 | * @param Connection $connection |
| 85 | 84 | */ |
| 86 | - public function __construct(protected Connection $connection) |
|
| 87 | - { |
|
| 85 | + public function __construct(protected Connection $connection) { |
|
| 88 | 86 | } |
| 89 | 87 | |
| 90 | 88 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @param QueryStatement|null $queryStatement |
| 59 | 59 | */ |
| 60 | 60 | public function __construct( |
| 61 | - string|array $from, |
|
| 61 | + string | array $from, |
|
| 62 | 62 | ?QueryStatement $queryStatement = null |
| 63 | 63 | ) { |
| 64 | 64 | parent::__construct($queryStatement); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param string|array<string> $tables |
| 75 | 75 | * @return mixed |
| 76 | 76 | */ |
| 77 | - public function delete(string|array $tables = []): mixed |
|
| 77 | + public function delete(string | array $tables = []): mixed |
|
| 78 | 78 | { |
| 79 | 79 | if (!is_array($tables)) { |
| 80 | 80 | $tables = [$tables]; |
@@ -50,8 +50,7 @@ |
||
| 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 | * DeleteStatement constructor. |
| 57 | 56 | * @param string|array<string> $from |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param Closure|null $value |
| 90 | 90 | * @return $this |
| 91 | 91 | */ |
| 92 | - public function having(string|Expression|Closure $column, ?Closure $value = null): self |
|
| 92 | + public function having(string | Expression | Closure $column, ?Closure $value = null): self |
|
| 93 | 93 | { |
| 94 | 94 | return $this->addCondition($column, $value, 'AND'); |
| 95 | 95 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param Closure|null $value |
| 100 | 100 | * @return $this |
| 101 | 101 | */ |
| 102 | - public function orHaving(string|Expression|Closure $column, ?Closure $value = null): self |
|
| 102 | + public function orHaving(string | Expression | Closure $column, ?Closure $value = null): self |
|
| 103 | 103 | { |
| 104 | 104 | return $this->addCondition($column, $value, 'OR'); |
| 105 | 105 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @return $this |
| 121 | 121 | */ |
| 122 | 122 | protected function addCondition( |
| 123 | - string|Expression|Closure $column, |
|
| 123 | + string | Expression | Closure $column, |
|
| 124 | 124 | ?Closure $value = null, |
| 125 | 125 | string $separator = 'AND' |
| 126 | 126 | ): self { |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * @class HavingStatement |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class HavingStatement |
|
| 56 | -{ |
|
| 55 | +class HavingStatement { |
|
| 57 | 56 | /** |
| 58 | 57 | * The Query statement instance |
| 59 | 58 | * @var QueryStatement |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | * HavingStatement constructor. |
| 71 | 70 | * @param QueryStatement|null $queryStatement |
| 72 | 71 | */ |
| 73 | - public function __construct(?QueryStatement $queryStatement = null) |
|
| 74 | - { |
|
| 72 | + public function __construct(?QueryStatement $queryStatement = null) { |
|
| 75 | 73 | $this->queryStatement = $queryStatement ?? new QueryStatement(); |
| 76 | 74 | $this->expression = new HavingExpression($this->queryStatement); |
| 77 | 75 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * @param QueryStatement|null $queryStatement |
| 65 | 65 | */ |
| 66 | 66 | public function __construct( |
| 67 | - string|array $table, |
|
| 67 | + string | array $table, |
|
| 68 | 68 | ?QueryStatement $queryStatement = null |
| 69 | 69 | ) { |
| 70 | 70 | parent::__construct($queryStatement); |
@@ -50,8 +50,7 @@ |
||
| 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 | * The Query statement instance |
| 57 | 56 | * @var QueryStatement |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | * @return WhereStatement|Where|Select|Delete|Update |
| 92 | 92 | */ |
| 93 | 93 | public function where( |
| 94 | - string|Expression|Closure $column, |
|
| 94 | + string | Expression | Closure $column, |
|
| 95 | 95 | bool $isExpression = false |
| 96 | - ): WhereStatement|Where|Select|Delete|Update { |
|
| 96 | + ): WhereStatement | Where | Select | Delete | Update { |
|
| 97 | 97 | return $this->addWhereCondition($column, 'AND', $isExpression); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | * @return WhereStatement|Where|Select|Delete|Update |
| 105 | 105 | */ |
| 106 | 106 | public function orWhere( |
| 107 | - string|Expression|Closure $column, |
|
| 107 | + string | Expression | Closure $column, |
|
| 108 | 108 | bool $isExpression = false |
| 109 | - ): WhereStatement|Where|Select|Delete|Update { |
|
| 109 | + ): WhereStatement | Where | Select | Delete | Update { |
|
| 110 | 110 | return $this->addWhereCondition($column, 'OR', $isExpression); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @param Closure $select |
| 115 | 115 | * @return WhereStatement|Select|Delete|Update |
| 116 | 116 | */ |
| 117 | - public function whereExists(Closure $select): WhereStatement|Select|Delete|Update |
|
| 117 | + public function whereExists(Closure $select): WhereStatement | Select | Delete | Update |
|
| 118 | 118 | { |
| 119 | 119 | return $this->addWhereExistsCondition($select, 'AND', false); |
| 120 | 120 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @param Closure $select |
| 124 | 124 | * @return WhereStatement|Select|Delete|Update |
| 125 | 125 | */ |
| 126 | - public function orWhereExists(Closure $select): WhereStatement|Select|Delete|Update |
|
| 126 | + public function orWhereExists(Closure $select): WhereStatement | Select | Delete | Update |
|
| 127 | 127 | { |
| 128 | 128 | return $this->addWhereExistsCondition($select, 'OR', false); |
| 129 | 129 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * @param Closure $select |
| 133 | 133 | * @return WhereStatement|Select|Delete|Update |
| 134 | 134 | */ |
| 135 | - public function whereNotExists(Closure $select): WhereStatement|Select|Delete|Update |
|
| 135 | + public function whereNotExists(Closure $select): WhereStatement | Select | Delete | Update |
|
| 136 | 136 | { |
| 137 | 137 | return $this->addWhereExistsCondition($select, 'AND', true); |
| 138 | 138 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param Closure $select |
| 142 | 142 | * @return WhereStatement|Select|Delete|Update |
| 143 | 143 | */ |
| 144 | - public function orWhereNotExists(Closure $select): WhereStatement|Select|Delete|Update |
|
| 144 | + public function orWhereNotExists(Closure $select): WhereStatement | Select | Delete | Update |
|
| 145 | 145 | { |
| 146 | 146 | return $this->addWhereExistsCondition($select, 'OR', true); |
| 147 | 147 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | mixed $column, |
| 167 | 167 | string $separator = 'AND', |
| 168 | 168 | bool $isExpression = false |
| 169 | - ): WhereStatement|Where { |
|
| 169 | + ): WhereStatement | Where { |
|
| 170 | 170 | if (($column instanceof Closure) && !$isExpression) { |
| 171 | 171 | $this->queryStatement->addWhereGroup($column, $separator); |
| 172 | 172 | |
@@ -52,8 +52,7 @@ discard block |
||
| 52 | 52 | * @class WhereStatement |
| 53 | 53 | * @package Platine\Database\Query |
| 54 | 54 | */ |
| 55 | -class WhereStatement |
|
| 56 | -{ |
|
| 55 | +class WhereStatement { |
|
| 57 | 56 | /** |
| 58 | 57 | * The Query statement instance |
| 59 | 58 | * @var QueryStatement |
@@ -70,8 +69,7 @@ discard block |
||
| 70 | 69 | * WhereStatement constructor. |
| 71 | 70 | * @param QueryStatement|null $queryStatement |
| 72 | 71 | */ |
| 73 | - public function __construct(?QueryStatement $queryStatement = null) |
|
| 74 | - { |
|
| 72 | + public function __construct(?QueryStatement $queryStatement = null) { |
|
| 75 | 73 | $this->queryStatement = $queryStatement ?? new QueryStatement(); |
| 76 | 74 | $this->where = new Where($this, $this->queryStatement); |
| 77 | 75 | } |