@@ -376,7 +376,7 @@ |
||
| 376 | 376 | |
| 377 | 377 | return (string) preg_replace_callback( |
| 378 | 378 | '/\?/', |
| 379 | - function () use ($driver, &$params) { |
|
| 379 | + function() use ($driver, &$params) { |
|
| 380 | 380 | $param = array_shift($params); |
| 381 | 381 | |
| 382 | 382 | $value = is_object($param) ? get_class($param) : $param; |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | * @param string|array<string> $tables Table name or an array of tables |
| 124 | 124 | * @return QueryCommand |
| 125 | 125 | */ |
| 126 | - public function from(string|array $tables): QueryCommand |
|
| 126 | + public function from(string | array $tables): QueryCommand |
|
| 127 | 127 | { |
| 128 | 128 | return new QueryCommand($this->connection, $tables); |
| 129 | 129 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * @param string|null $name |
| 200 | 200 | * @return $this |
| 201 | 201 | */ |
| 202 | - public function primary(string|array $columns, ?string $name = null): self |
|
| 202 | + public function primary(string | array $columns, ?string $name = null): self |
|
| 203 | 203 | { |
| 204 | 204 | if (!is_array($columns)) { |
| 205 | 205 | $columns = [$columns]; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @param string|null $name |
| 224 | 224 | * @return $this |
| 225 | 225 | */ |
| 226 | - public function unique(string|array $columns, ?string $name = null): self |
|
| 226 | + public function unique(string | array $columns, ?string $name = null): self |
|
| 227 | 227 | { |
| 228 | 228 | if (!is_array($columns)) { |
| 229 | 229 | $columns = [$columns]; |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | * @param string|null $name |
| 245 | 245 | * @return $this |
| 246 | 246 | */ |
| 247 | - public function index(string|array $columns, ?string $name = null): self |
|
| 247 | + public function index(string | array $columns, ?string $name = null): self |
|
| 248 | 248 | { |
| 249 | 249 | if (!is_array($columns)) { |
| 250 | 250 | $columns = [$columns]; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * @param string|null $name |
| 266 | 266 | * @return ForeignKey |
| 267 | 267 | */ |
| 268 | - public function foreign(string|array $columns, ?string $name = null): ForeignKey |
|
| 268 | + public function foreign(string | array $columns, ?string $name = null): ForeignKey |
|
| 269 | 269 | { |
| 270 | 270 | if (!is_array($columns)) { |
| 271 | 271 | $columns = [$columns]; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function __construct( |
| 70 | 70 | Connection $connection, |
| 71 | - string|array $from, |
|
| 71 | + string | array $from, |
|
| 72 | 72 | ?QueryStatement $queryStatement = null |
| 73 | 73 | ) { |
| 74 | 74 | parent::__construct($from, $queryStatement); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return int |
| 84 | 84 | * @throws QueryException |
| 85 | 85 | */ |
| 86 | - public function delete(string|array $tables = []): int |
|
| 86 | + public function delete(string | array $tables = []): int |
|
| 87 | 87 | { |
| 88 | 88 | parent::delete($tables); |
| 89 | 89 | $driver = $this->connection->getDriver(); |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | * @return $this |
| 76 | 76 | */ |
| 77 | 77 | public function on( |
| 78 | - string|Expression|Closure $column1, |
|
| 79 | - string|Expression|Closure|bool|null $column2 = null, |
|
| 78 | + string | Expression | Closure $column1, |
|
| 79 | + string | Expression | Closure | bool | null $column2 = null, |
|
| 80 | 80 | string $operator = '=' |
| 81 | 81 | ): self { |
| 82 | 82 | return $this->addJoinCondition($column1, $column2, $operator, 'AND'); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | * @return $this |
| 90 | 90 | */ |
| 91 | 91 | public function andOn( |
| 92 | - string|Expression|Closure $column1, |
|
| 93 | - string|Expression|Closure|bool|null $column2 = null, |
|
| 92 | + string | Expression | Closure $column1, |
|
| 93 | + string | Expression | Closure | bool | null $column2 = null, |
|
| 94 | 94 | string $operator = '=' |
| 95 | 95 | ): self { |
| 96 | 96 | return $this->addJoinCondition($column1, $column2, $operator, 'AND'); |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | * @return $this |
| 104 | 104 | */ |
| 105 | 105 | public function orOn( |
| 106 | - string|Expression|Closure $column1, |
|
| 107 | - string|Expression|Closure|bool|null $column2 = null, |
|
| 106 | + string | Expression | Closure $column1, |
|
| 107 | + string | Expression | Closure | bool | null $column2 = null, |
|
| 108 | 108 | string $operator = '=' |
| 109 | 109 | ): self { |
| 110 | 110 | return $this->addJoinCondition($column1, $column2, $operator, 'OR'); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | * @param string $separator |
| 116 | 116 | * @return $this |
| 117 | 117 | */ |
| 118 | - protected function addJoinExpression(Expression|Closure $expression, string $separator = 'AND'): self |
|
| 118 | + protected function addJoinExpression(Expression | Closure $expression, string $separator = 'AND'): self |
|
| 119 | 119 | { |
| 120 | 120 | if ($expression instanceof Closure) { |
| 121 | 121 | $expression = Expression::fromClosure($expression); |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | * @return $this |
| 139 | 139 | */ |
| 140 | 140 | protected function addJoinCondition( |
| 141 | - string|Expression|Closure $column1, |
|
| 142 | - string|Expression|Closure|bool|null $column2, |
|
| 141 | + string | Expression | Closure $column1, |
|
| 142 | + string | Expression | Closure | bool | null $column2, |
|
| 143 | 143 | string $operator, |
| 144 | 144 | string $separator = 'AND' |
| 145 | 145 | ): self { |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | * @param string|array<int, string> $tables |
| 63 | 63 | * @return SelectStatement |
| 64 | 64 | */ |
| 65 | - public function from(string|array $tables): SelectStatement |
|
| 65 | + public function from(string | array $tables): SelectStatement |
|
| 66 | 66 | { |
| 67 | 67 | return $this->select = new SelectStatement($tables); |
| 68 | 68 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | /** |
| 58 | 58 | * @var string|Expression |
| 59 | 59 | */ |
| 60 | - protected string|Expression $aggregate; |
|
| 60 | + protected string | Expression $aggregate; |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @var string |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @param string $separator |
| 85 | 85 | * @return self |
| 86 | 86 | */ |
| 87 | - public function init(string|Expression|Closure $aggregate, string $separator): self |
|
| 87 | + public function init(string | Expression | Closure $aggregate, string $separator): self |
|
| 88 | 88 | { |
| 89 | 89 | if ($aggregate instanceof Closure) { |
| 90 | 90 | $aggregate = Expression::fromClosure($aggregate); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | * @param array<int, mixed>|Closure $value |
| 212 | 212 | * @return void |
| 213 | 213 | */ |
| 214 | - public function in(array|Closure $value): void |
|
| 214 | + public function in(array | Closure $value): void |
|
| 215 | 215 | { |
| 216 | 216 | $this->queryStatement->addHavingIn( |
| 217 | 217 | $this->aggregate, |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @param array<int, mixed>|Closure $value |
| 226 | 226 | * @return void |
| 227 | 227 | */ |
| 228 | - public function notIn(array|Closure $value): void |
|
| 228 | + public function notIn(array | Closure $value): void |
|
| 229 | 229 | { |
| 230 | 230 | $this->queryStatement->addHavingIn( |
| 231 | 231 | $this->aggregate, |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @return Delete|Select|BaseStatement |
| 62 | 62 | */ |
| 63 | - public function join(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
| 63 | + public function join(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
| 64 | 64 | { |
| 65 | 65 | $this->queryStatement->addJoinClause('INNER', $table, $closure); |
| 66 | 66 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * @return Delete|Select|BaseStatement |
| 75 | 75 | */ |
| 76 | - public function leftJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
| 76 | + public function leftJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
| 77 | 77 | { |
| 78 | 78 | $this->queryStatement->addJoinClause('LEFT', $table, $closure); |
| 79 | 79 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return Delete|Select|BaseStatement |
| 88 | 88 | */ |
| 89 | - public function rightJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
| 89 | + public function rightJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
| 90 | 90 | { |
| 91 | 91 | $this->queryStatement->addJoinClause('RIGHT', $table, $closure); |
| 92 | 92 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @return Delete|Select|BaseStatement |
| 101 | 101 | */ |
| 102 | - public function fullJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
| 102 | + public function fullJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
| 103 | 103 | { |
| 104 | 104 | $this->queryStatement->addJoinClause('FULL', $table, $closure); |
| 105 | 105 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @return Delete|Select|BaseStatement |
| 114 | 114 | */ |
| 115 | - public function crossJoin(array|string $table, Closure $closure): Delete|Select|BaseStatement |
|
| 115 | + public function crossJoin(array | string $table, Closure $closure): Delete | Select | BaseStatement |
|
| 116 | 116 | { |
| 117 | 117 | $this->queryStatement->addJoinClause('CROSS', $table, $closure); |
| 118 | 118 | |
@@ -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 | |