@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @param string|null $alias |
75 | 75 | * @return $this |
76 | 76 | */ |
77 | - public function column(string|Expression|Closure $name, string $alias = null): self |
|
77 | + public function column(string | Expression | Closure $name, string $alias = null): self |
|
78 | 78 | { |
79 | 79 | $this->queryStatement->addColumn($name, $alias); |
80 | 80 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @return $this |
112 | 112 | */ |
113 | 113 | public function count( |
114 | - string|array|Expression|Closure $column = '*', |
|
114 | + string | array | Expression | Closure $column = '*', |
|
115 | 115 | string $alias = null, |
116 | 116 | bool $distinct = false |
117 | 117 | ): self { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return $this |
126 | 126 | */ |
127 | 127 | public function avg( |
128 | - string|Expression|Closure $column, |
|
128 | + string | Expression | Closure $column, |
|
129 | 129 | string $alias = null, |
130 | 130 | bool $distinct = false |
131 | 131 | ): self { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @return $this |
140 | 140 | */ |
141 | 141 | public function sum( |
142 | - string|Expression|Closure $column, |
|
142 | + string | Expression | Closure $column, |
|
143 | 143 | string $alias = null, |
144 | 144 | bool $distinct = false |
145 | 145 | ): self { |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return $this |
154 | 154 | */ |
155 | 155 | public function min( |
156 | - string|Expression|Closure $column, |
|
156 | + string | Expression | Closure $column, |
|
157 | 157 | string $alias = null, |
158 | 158 | bool $distinct = false |
159 | 159 | ): self { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @return $this |
168 | 168 | */ |
169 | 169 | public function max( |
170 | - string|Expression|Closure $column, |
|
170 | + string | Expression | Closure $column, |
|
171 | 171 | string $alias = null, |
172 | 172 | bool $distinct = false |
173 | 173 | ): self { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param string|array<int, string> $tables |
65 | 65 | * @param QueryStatement|null $queryStatement |
66 | 66 | */ |
67 | - public function __construct(string|array $tables, ?QueryStatement $queryStatement = null) |
|
67 | + public function __construct(string | array $tables, ?QueryStatement $queryStatement = null) |
|
68 | 68 | { |
69 | 69 | parent::__construct($queryStatement); |
70 | 70 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @param string|Expression|Closure|string[]|Expression[]|Closure[] $columns |
103 | 103 | * @return $this |
104 | 104 | */ |
105 | - public function groupBy(string|Expression|Closure|array $columns): self |
|
105 | + public function groupBy(string | Expression | Closure | array $columns): self |
|
106 | 106 | { |
107 | 107 | if (!is_array($columns)) { |
108 | 108 | $columns = [$columns]; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param Closure|null $closure |
118 | 118 | * @return $this |
119 | 119 | */ |
120 | - public function having(string|Expression|Closure $column, ?Closure $closure = null): self |
|
120 | + public function having(string | Expression | Closure $column, ?Closure $closure = null): self |
|
121 | 121 | { |
122 | 122 | $this->havingStatement->having($column, $closure); |
123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return $this |
131 | 131 | */ |
132 | 132 | public function orHaving( |
133 | - string|Expression|Closure $column, |
|
133 | + string | Expression | Closure $column, |
|
134 | 134 | ?Closure $closure = null |
135 | 135 | ): self { |
136 | 136 | $this->havingStatement->orHaving($column, $closure); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @return $this |
145 | 145 | */ |
146 | 146 | public function orderBy( |
147 | - string|Closure|Expression|array $columns, |
|
147 | + string | Closure | Expression | array $columns, |
|
148 | 148 | string $order = 'ASC' |
149 | 149 | ): self { |
150 | 150 | if (!is_array($columns)) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @param string|Expression|Closure|string[]|Expression[]|Closure[] $columns |
183 | 183 | * @return mixed |
184 | 184 | */ |
185 | - public function select(string|Expression|Closure|array $columns = []): mixed |
|
185 | + public function select(string | Expression | Closure | array $columns = []): mixed |
|
186 | 186 | { |
187 | 187 | $expr = new ColumnExpression($this->queryStatement); |
188 | 188 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @param string|Expression|Closure $name |
203 | 203 | * @return mixed |
204 | 204 | */ |
205 | - public function column(string|Expression|Closure $name): mixed |
|
205 | + public function column(string | Expression | Closure $name): mixed |
|
206 | 206 | { |
207 | 207 | (new ColumnExpression($this->queryStatement))->column($name); |
208 | 208 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @return mixed |
216 | 216 | */ |
217 | 217 | public function count( |
218 | - string|Expression|Closure $column = '*', |
|
218 | + string | Expression | Closure $column = '*', |
|
219 | 219 | bool $distinct = false |
220 | 220 | ): mixed { |
221 | 221 | (new ColumnExpression($this->queryStatement))->count($column, null, $distinct); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * @return mixed |
230 | 230 | */ |
231 | 231 | public function avg( |
232 | - string|Expression|Closure $column, |
|
232 | + string | Expression | Closure $column, |
|
233 | 233 | bool $distinct = false |
234 | 234 | ): mixed { |
235 | 235 | (new ColumnExpression($this->queryStatement))->avg($column, null, $distinct); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param bool $distinct |
243 | 243 | * @return mixed |
244 | 244 | */ |
245 | - public function sum(string|Expression|Closure $column, bool $distinct = false): mixed |
|
245 | + public function sum(string | Expression | Closure $column, bool $distinct = false): mixed |
|
246 | 246 | { |
247 | 247 | (new ColumnExpression($this->queryStatement))->sum($column, null, $distinct); |
248 | 248 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | * @param bool $distinct |
255 | 255 | * @return mixed |
256 | 256 | */ |
257 | - public function min(string|Expression|Closure $column, bool $distinct = false): mixed |
|
257 | + public function min(string | Expression | Closure $column, bool $distinct = false): mixed |
|
258 | 258 | { |
259 | 259 | (new ColumnExpression($this->queryStatement))->min($column, null, $distinct); |
260 | 260 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @param bool $distinct |
267 | 267 | * @return mixed |
268 | 268 | */ |
269 | - public function max(string|Expression|Closure $column, bool $distinct = false): mixed |
|
269 | + public function max(string | Expression | Closure $column, bool $distinct = false): mixed |
|
270 | 270 | { |
271 | 271 | (new ColumnExpression($this->queryStatement))->max($column, null, $distinct); |
272 | 272 |
@@ -52,8 +52,7 @@ discard block |
||
52 | 52 | * @class SelectStatement |
53 | 53 | * @package Platine\Database\Query |
54 | 54 | */ |
55 | -class SelectStatement extends BaseStatement |
|
56 | -{ |
|
55 | +class SelectStatement extends BaseStatement { |
|
57 | 56 | /** |
58 | 57 | * @var HavingStatement |
59 | 58 | */ |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | * @param string|array<int, string> $tables |
65 | 64 | * @param QueryStatement|null $queryStatement |
66 | 65 | */ |
67 | - public function __construct(string|array $tables, ?QueryStatement $queryStatement = null) |
|
68 | - { |
|
66 | + public function __construct(string|array $tables, ?QueryStatement $queryStatement = null) { |
|
69 | 67 | parent::__construct($queryStatement); |
70 | 68 | |
71 | 69 | if (!is_array($tables)) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param string|array<string> $tables |
112 | 112 | * @return SelectStatement |
113 | 113 | */ |
114 | - public function from(string|array $tables): SelectStatement |
|
114 | + public function from(string | array $tables): SelectStatement |
|
115 | 115 | { |
116 | 116 | $subQuery = new SubQuery(); |
117 | 117 | $this->addExpression('subquery', $subQuery); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @return $this |
126 | 126 | */ |
127 | 127 | public function count( |
128 | - string|array|Expression|Closure $column = '*', |
|
128 | + string | array | Expression | Closure $column = '*', |
|
129 | 129 | bool $distinct = false |
130 | 130 | ): self { |
131 | 131 | if (!is_array($column)) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @param bool $distinct |
146 | 146 | * @return $this |
147 | 147 | */ |
148 | - public function sum(string|Expression|Closure $column, bool $distinct = false): self |
|
148 | + public function sum(string | Expression | Closure $column, bool $distinct = false): self |
|
149 | 149 | { |
150 | 150 | return $this->addFunction( |
151 | 151 | 'aggregateFunction', |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param bool $distinct |
161 | 161 | * @return $this |
162 | 162 | */ |
163 | - public function avg(string|Expression|Closure $column, bool $distinct = false): self |
|
163 | + public function avg(string | Expression | Closure $column, bool $distinct = false): self |
|
164 | 164 | { |
165 | 165 | return $this->addFunction( |
166 | 166 | 'aggregateFunction', |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @param bool $distinct |
176 | 176 | * @return $this |
177 | 177 | */ |
178 | - public function min(string|Expression|Closure $column, bool $distinct = false): self |
|
178 | + public function min(string | Expression | Closure $column, bool $distinct = false): self |
|
179 | 179 | { |
180 | 180 | return $this->addFunction( |
181 | 181 | 'aggregateFunction', |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param bool $distinct |
191 | 191 | * @return $this |
192 | 192 | */ |
193 | - public function max(string|Expression|Closure $column, bool $distinct = false): self |
|
193 | + public function max(string | Expression | Closure $column, bool $distinct = false): self |
|
194 | 194 | { |
195 | 195 | return $this->addFunction( |
196 | 196 | 'aggregateFunction', |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | protected function addFunction( |
239 | 239 | string $type, |
240 | 240 | string $name, |
241 | - string|Closure|array|Expression $column, |
|
241 | + string | Closure | array | Expression $column, |
|
242 | 242 | array $arguments = [] |
243 | 243 | ): self { |
244 | 244 | if ($column instanceof Closure) { |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @param string $separator |
157 | 157 | */ |
158 | 158 | public function addWhere( |
159 | - string|Closure|Expression $column, |
|
159 | + string | Closure | Expression $column, |
|
160 | 160 | mixed $value, |
161 | 161 | string $operator, |
162 | 162 | string $separator |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @return void |
180 | 180 | */ |
181 | 181 | public function addWhereLike( |
182 | - string|Closure|Expression $column, |
|
182 | + string | Closure | Expression $column, |
|
183 | 183 | string $pattern, |
184 | 184 | string $separator, |
185 | 185 | bool $not |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @return void |
204 | 204 | */ |
205 | 205 | public function addWhereBetween( |
206 | - string|Closure|Expression $column, |
|
206 | + string | Closure | Expression $column, |
|
207 | 207 | mixed $value1, |
208 | 208 | mixed $value2, |
209 | 209 | string $separator, |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @return void |
229 | 229 | */ |
230 | 230 | public function addWhereIn( |
231 | - string|Closure|Expression $column, |
|
231 | + string | Closure | Expression $column, |
|
232 | 232 | mixed $value, |
233 | 233 | string $separator, |
234 | 234 | bool $not |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @return void |
266 | 266 | */ |
267 | 267 | public function addWhereNull( |
268 | - string|Closure|Expression $column, |
|
268 | + string | Closure | Expression $column, |
|
269 | 269 | string $separator, |
270 | 270 | bool $not |
271 | 271 | ): void { |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * @return void |
285 | 285 | */ |
286 | 286 | public function addWhereNop( |
287 | - string|Closure|Expression $column, |
|
287 | + string | Closure | Expression $column, |
|
288 | 288 | string $separator |
289 | 289 | ): void { |
290 | 290 | $this->wheres[] = [ |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function addJoinClause( |
323 | 323 | string $type, |
324 | - string|array|Closure $table, |
|
324 | + string | array | Closure $table, |
|
325 | 325 | ?Closure $closure = null |
326 | 326 | ): void { |
327 | 327 | $join = null; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | * @return void |
373 | 373 | */ |
374 | 374 | public function addHaving( |
375 | - string|Closure|Expression $aggregate, |
|
375 | + string | Closure | Expression $aggregate, |
|
376 | 376 | mixed $value, |
377 | 377 | string $operator, |
378 | 378 | string $separator |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | * @return void |
396 | 396 | */ |
397 | 397 | public function addHavingIn( |
398 | - string|Closure|Expression $aggregate, |
|
398 | + string | Closure | Expression $aggregate, |
|
399 | 399 | $value, |
400 | 400 | string $separator, |
401 | 401 | bool $not |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | * @return void |
435 | 435 | */ |
436 | 436 | public function addHavingBetween( |
437 | - string|Closure|Expression $aggregate, |
|
437 | + string | Closure | Expression $aggregate, |
|
438 | 438 | mixed $value1, |
439 | 439 | mixed $value2, |
440 | 440 | string $separator, |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @return void |
517 | 517 | */ |
518 | 518 | public function addColumn( |
519 | - string|Expression|Closure $column, |
|
519 | + string | Expression | Closure $column, |
|
520 | 520 | ?string $alias = null |
521 | 521 | ): void { |
522 | 522 | $this->columns[] = [ |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * |
54 | 54 | * @package Platine\Database\Query |
55 | 55 | */ |
56 | -class QueryStatement |
|
57 | -{ |
|
56 | +class QueryStatement { |
|
58 | 57 | /** |
59 | 58 | * The where SQL parts |
60 | 59 | * @var array<int, mixed> |
@@ -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 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * |
214 | 214 | * @return int|float |
215 | 215 | */ |
216 | - public function avg($column, bool $distinct = false): int|float |
|
216 | + public function avg($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($column, bool $distinct = false): int|float |
|
227 | + public function sum($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 | } |
@@ -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 |
@@ -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 |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param string $separator |
95 | 95 | * @return $this |
96 | 96 | */ |
97 | - public function init(string|Expression|Closure $column, string $separator): self |
|
97 | + public function init(string | Expression | Closure $column, string $separator): self |
|
98 | 98 | { |
99 | 99 | if ($column instanceof Closure) { |
100 | 100 | $column = Expression::fromClosure($column); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param bool $isColumn |
111 | 111 | * @return WhereStatement|Select|Delete|Update |
112 | 112 | */ |
113 | - public function is(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
113 | + public function is(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
114 | 114 | { |
115 | 115 | return $this->addCondition($value, '=', $isColumn); |
116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @param bool $isColumn |
121 | 121 | * @return WhereStatement|Select|Delete|Update |
122 | 122 | */ |
123 | - public function eq(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
123 | + public function eq(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
124 | 124 | { |
125 | 125 | return $this->is($value, $isColumn); |
126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @param bool $isColumn |
131 | 131 | * @return WhereStatement|Select|Delete|Update |
132 | 132 | */ |
133 | - public function isNot(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
133 | + public function isNot(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
134 | 134 | { |
135 | 135 | return $this->addCondition($value, '!=', $isColumn); |
136 | 136 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param bool $isColumn |
141 | 141 | * @return WhereStatement|Select|Delete|Update |
142 | 142 | */ |
143 | - public function neq(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
143 | + public function neq(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
144 | 144 | { |
145 | 145 | return $this->isNot($value, $isColumn); |
146 | 146 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @param bool $isColumn |
151 | 151 | * @return WhereStatement|Select|Delete|Update |
152 | 152 | */ |
153 | - public function lt(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
153 | + public function lt(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
154 | 154 | { |
155 | 155 | return $this->addCondition($value, '<', $isColumn); |
156 | 156 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param bool $isColumn |
161 | 161 | * @return WhereStatement|Select|Delete|Update |
162 | 162 | */ |
163 | - public function gt(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
163 | + public function gt(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
164 | 164 | { |
165 | 165 | return $this->addCondition($value, '>', $isColumn); |
166 | 166 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param bool $isColumn |
171 | 171 | * @return WhereStatement|Select|Delete|Update |
172 | 172 | */ |
173 | - public function lte(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
173 | + public function lte(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
174 | 174 | { |
175 | 175 | return $this->addCondition($value, '<=', $isColumn); |
176 | 176 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @param bool $isColumn |
181 | 181 | * @return WhereStatement|Select|Delete|Update |
182 | 182 | */ |
183 | - public function gte(mixed $value, bool $isColumn = false): WhereStatement|Select|Delete|Update |
|
183 | + public function gte(mixed $value, bool $isColumn = false): WhereStatement | Select | Delete | Update |
|
184 | 184 | { |
185 | 185 | return $this->addCondition($value, '>=', $isColumn); |
186 | 186 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * @param mixed $value2 |
191 | 191 | * @return WhereStatement|Select|Delete|Update |
192 | 192 | */ |
193 | - public function between(mixed $value1, mixed $value2): WhereStatement|Select|Delete|Update |
|
193 | + public function between(mixed $value1, mixed $value2): WhereStatement | Select | Delete | Update |
|
194 | 194 | { |
195 | 195 | return $this->addBetweenCondition($value1, $value2, false); |
196 | 196 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * @param mixed $value2 |
201 | 201 | * @return WhereStatement|Select|Delete|Update |
202 | 202 | */ |
203 | - public function notBetween(mixed $value1, mixed $value2): WhereStatement|Select|Delete|Update |
|
203 | + public function notBetween(mixed $value1, mixed $value2): WhereStatement | Select | Delete | Update |
|
204 | 204 | { |
205 | 205 | return $this->addBetweenCondition($value1, $value2, true); |
206 | 206 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @param mixed $value |
210 | 210 | * @return WhereStatement|Select|Delete|Update |
211 | 211 | */ |
212 | - public function like(mixed $value): WhereStatement|Select|Delete|Update |
|
212 | + public function like(mixed $value): WhereStatement | Select | Delete | Update |
|
213 | 213 | { |
214 | 214 | return $this->addLikeCondition($value, false); |
215 | 215 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @param mixed $value |
219 | 219 | * @return WhereStatement|Select|Delete|Update |
220 | 220 | */ |
221 | - public function notLike(mixed $value): WhereStatement|Select|Delete|Update |
|
221 | + public function notLike(mixed $value): WhereStatement | Select | Delete | Update |
|
222 | 222 | { |
223 | 223 | return $this->addLikeCondition($value, true); |
224 | 224 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @param array<int, mixed>|Closure $value |
228 | 228 | * @return WhereStatement |
229 | 229 | */ |
230 | - public function in(array|Closure $value): WhereStatement |
|
230 | + public function in(array | Closure $value): WhereStatement |
|
231 | 231 | { |
232 | 232 | return $this->addInCondition($value, false); |
233 | 233 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * @param array<int, mixed>|Closure $value |
237 | 237 | * @return WhereStatement |
238 | 238 | */ |
239 | - public function notIn(array|Closure $value): WhereStatement |
|
239 | + public function notIn(array | Closure $value): WhereStatement |
|
240 | 240 | { |
241 | 241 | return $this->addInCondition($value, true); |
242 | 242 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | /** |
245 | 245 | * @return WhereStatement|Select|Delete|Update |
246 | 246 | */ |
247 | - public function isNull(): WhereStatement|Select|Delete|Update |
|
247 | + public function isNull(): WhereStatement | Select | Delete | Update |
|
248 | 248 | { |
249 | 249 | return $this->addNullCondition(false); |
250 | 250 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * @return WhereStatement|Select|Delete|Update |
254 | 254 | */ |
255 | - public function isNotNull(): WhereStatement|Select|Delete|Update |
|
255 | + public function isNotNull(): WhereStatement | Select | Delete | Update |
|
256 | 256 | { |
257 | 257 | return $this->addNullCondition(true); |
258 | 258 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | /** |
261 | 261 | * @return WhereStatement|Select|Delete|Update |
262 | 262 | */ |
263 | - public function nop(): WhereStatement|Select|Delete|Update |
|
263 | + public function nop(): WhereStatement | Select | Delete | Update |
|
264 | 264 | { |
265 | 265 | $this->queryStatement->addWhereNop($this->column, $this->separator); |
266 | 266 | |
@@ -289,9 +289,9 @@ discard block |
||
289 | 289 | mixed $value, |
290 | 290 | string $operator, |
291 | 291 | bool $isColumn = false |
292 | - ): WhereStatement|Select|Delete|Update { |
|
292 | + ): WhereStatement | Select | Delete | Update { |
|
293 | 293 | if ($isColumn && is_string($value)) { |
294 | - $value = function (Expression $expr) use ($value) { |
|
294 | + $value = function(Expression $expr) use ($value) { |
|
295 | 295 | return $expr->column($value); |
296 | 296 | }; |
297 | 297 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @param bool $not |
312 | 312 | * @return WhereStatement|Select|Delete|update |
313 | 313 | */ |
314 | - protected function addBetweenCondition(mixed $value1, mixed $value2, bool $not): WhereStatement|Select|Delete|update |
|
314 | + protected function addBetweenCondition(mixed $value1, mixed $value2, bool $not): WhereStatement | Select | Delete | update |
|
315 | 315 | { |
316 | 316 | $this->queryStatement->addWhereBetween( |
317 | 317 | $this->column, |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @param bool $not |
330 | 330 | * @return WhereStatement|Select|Delete|update |
331 | 331 | */ |
332 | - protected function addLikeCondition(string $pattern, bool $not): WhereStatement|Select|Delete|update |
|
332 | + protected function addLikeCondition(string $pattern, bool $not): WhereStatement | Select | Delete | update |
|
333 | 333 | { |
334 | 334 | $this->queryStatement->addWhereLike( |
335 | 335 | $this->column, |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | * @param bool $not |
347 | 347 | * @return WhereStatement|Select|Delete|update |
348 | 348 | */ |
349 | - protected function addInCondition(mixed $value, bool $not): WhereStatement|Select|Delete|update |
|
349 | + protected function addInCondition(mixed $value, bool $not): WhereStatement | Select | Delete | update |
|
350 | 350 | { |
351 | 351 | $this->queryStatement->addWhereIn($this->column, $value, $this->separator, $not); |
352 | 352 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | * @param bool $not |
358 | 358 | * @return WhereStatement|Select|Delete|Update |
359 | 359 | */ |
360 | - protected function addNullCondition(bool $not): WhereStatement|Select|Delete|Update |
|
360 | + protected function addNullCondition(bool $not): WhereStatement | Select | Delete | Update |
|
361 | 361 | { |
362 | 362 | $this->queryStatement->addWhereNull($this->column, $this->separator, $not); |
363 | 363 |
@@ -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 | */ |
@@ -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); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * |
125 | 125 | * @return int|float |
126 | 126 | */ |
127 | - public function avg(string|Expression|Closure $column, bool $distinct = false): int|float |
|
127 | + public function avg(string | Expression | Closure $column, bool $distinct = false): int | float |
|
128 | 128 | { |
129 | 129 | parent::avg($column, $distinct); |
130 | 130 | return $this->getColumnResult(); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return int|float |
138 | 138 | */ |
139 | - public function sum(string|Expression|Closure $column, bool $distinct = false): int|float |
|
139 | + public function sum(string | Expression | Closure $column, bool $distinct = false): int | float |
|
140 | 140 | { |
141 | 141 | parent::sum($column, $distinct); |
142 | 142 | return $this->getColumnResult(); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return int|float |
150 | 150 | */ |
151 | - public function min(string|Expression|Closure $column, bool $distinct = false): int|float |
|
151 | + public function min(string | Expression | Closure $column, bool $distinct = false): int | float |
|
152 | 152 | { |
153 | 153 | parent::min($column, $distinct); |
154 | 154 | return $this->getColumnResult(); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * |
161 | 161 | * @return int|float |
162 | 162 | */ |
163 | - public function max(string|Expression|Closure $column, bool $distinct = false): int|float |
|
163 | + public function max(string | Expression | Closure $column, bool $distinct = false): int | float |
|
164 | 164 | { |
165 | 165 | parent::max($column, $distinct); |
166 | 166 | return $this->getColumnResult(); |
@@ -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 | */ |
@@ -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 | * The Query statement instance |
57 | 56 | * @var QueryStatement |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * InsertStatement constructor. |
63 | 62 | * @param QueryStatement|null $queryStatement |
64 | 63 | */ |
65 | - public function __construct(?QueryStatement $queryStatement = null) |
|
66 | - { |
|
64 | + public function __construct(?QueryStatement $queryStatement = null) { |
|
67 | 65 | if ($queryStatement === null) { |
68 | 66 | $queryStatement = new QueryStatement(); |
69 | 67 | } |
@@ -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 |
@@ -129,8 +128,7 @@ discard block |
||
129 | 128 | * @class constructor |
130 | 129 | * @param Connection $connection |
131 | 130 | */ |
132 | - public function __construct(Connection $connection) |
|
133 | - { |
|
131 | + public function __construct(Connection $connection) { |
|
134 | 132 | $this->connection = $connection; |
135 | 133 | } |
136 | 134 |