@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param int $fetchStyle the PDO fetch style |
| 96 | 96 | * @return array<int, mixed>|false |
| 97 | 97 | */ |
| 98 | - public function all(?callable $callable = null, int $fetchStyle = 0): array|false |
|
| 98 | + public function all(?callable $callable = null, int $fetchStyle = 0): array | false |
|
| 99 | 99 | { |
| 100 | 100 | if ($callable === null) { |
| 101 | 101 | return $this->statement->fetchAll($fetchStyle); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param callable|null $callable |
| 110 | 110 | * @return array<int, mixed>|false |
| 111 | 111 | */ |
| 112 | - public function allGroup(bool $uniq = false, ?callable $callable = null): array|false |
|
| 112 | + public function allGroup(bool $uniq = false, ?callable $callable = null): array | false |
|
| 113 | 113 | { |
| 114 | 114 | $fetchStyle = PDO::FETCH_GROUP | ($uniq ? PDO::FETCH_UNIQUE : 0); |
| 115 | 115 | |
@@ -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]; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | * @param string|null $name |
| 172 | 172 | * @return $this |
| 173 | 173 | */ |
| 174 | - public function primary(string|array $columns, ?string $name = null): self |
|
| 174 | + public function primary(string | array $columns, ?string $name = null): self |
|
| 175 | 175 | { |
| 176 | 176 | return $this->addKey('addPrimary', $columns, $name); |
| 177 | 177 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param string|null $name |
| 183 | 183 | * @return $this |
| 184 | 184 | */ |
| 185 | - public function unique(string|array $columns, ?string $name = null): self |
|
| 185 | + public function unique(string | array $columns, ?string $name = null): self |
|
| 186 | 186 | { |
| 187 | 187 | return $this->addKey('addUnique', $columns, $name); |
| 188 | 188 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param string|null $name |
| 194 | 194 | * @return $this |
| 195 | 195 | */ |
| 196 | - public function index(string|array $columns, ?string $name = null): self |
|
| 196 | + public function index(string | array $columns, ?string $name = null): self |
|
| 197 | 197 | { |
| 198 | 198 | return $this->addKey('addIndex', $columns, $name); |
| 199 | 199 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param string|null $name |
| 205 | 205 | * @return ForeignKey |
| 206 | 206 | */ |
| 207 | - public function foreign(string|array $columns, ?string $name = null): ForeignKey |
|
| 207 | + public function foreign(string | array $columns, ?string $name = null): ForeignKey |
|
| 208 | 208 | { |
| 209 | 209 | if (!is_array($columns)) { |
| 210 | 210 | $columns = [$columns]; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | * @param string|null $name |
| 567 | 567 | * @return $this |
| 568 | 568 | */ |
| 569 | - protected function addKey(string $type, string|array $columns, ?string $name = null): self |
|
| 569 | + protected function addKey(string $type, string | array $columns, ?string $name = null): self |
|
| 570 | 570 | { |
| 571 | 571 | static $maps = [ |
| 572 | 572 | 'addPrimary' => 'pk', |
@@ -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(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function __construct( |
| 69 | 69 | Connection $connection, |
| 70 | - string|array $table, |
|
| 70 | + string | array $table, |
|
| 71 | 71 | ?QueryStatement $queryStatement = null |
| 72 | 72 | ) { |
| 73 | 73 | parent::__construct($table, $queryStatement); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param mixed $value |
| 118 | 118 | * @return int |
| 119 | 119 | */ |
| 120 | - protected function incrementOrDecrement(string $sign, string|array $columns, mixed $value): int |
|
| 120 | + protected function incrementOrDecrement(string $sign, string | array $columns, mixed $value): int |
|
| 121 | 121 | { |
| 122 | 122 | if (!is_array($columns)) { |
| 123 | 123 | $columns = [$columns]; |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | foreach ($columns as $key => $val) { |
| 129 | 129 | if (is_numeric($key)) { |
| 130 | - $values[$val] = function (Expression $expr) use ($sign, $val, $value) { |
|
| 130 | + $values[$val] = function(Expression $expr) use ($sign, $val, $value) { |
|
| 131 | 131 | $expr->column($val)->op($sign)->value($value); |
| 132 | 132 | }; |
| 133 | 133 | } else { |
| 134 | - $values[$key] = function (Expression $expr) use ($sign, $key, $val) { |
|
| 134 | + $values[$key] = function(Expression $expr) use ($sign, $key, $val) { |
|
| 135 | 135 | $expr->column($key)->op($sign)->value($val); |
| 136 | 136 | }; |
| 137 | 137 | } |
@@ -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 { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * @var string|Expression |
| 74 | 74 | */ |
| 75 | - protected string|Expression $column; |
|
| 75 | + protected string | Expression $column; |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * @var string |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param string $separator |
| 96 | 96 | * @return self |
| 97 | 97 | */ |
| 98 | - public function init(string|Expression|Closure $column, string $separator): self |
|
| 98 | + public function init(string | Expression | Closure $column, string $separator): self |
|
| 99 | 99 | { |
| 100 | 100 | if ($column instanceof Closure) { |
| 101 | 101 | $column = Expression::fromClosure($column); |
@@ -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 = []) |
|
| 77 | + public function delete(string | array $tables = []) |
|
| 78 | 78 | { |
| 79 | 79 | if (!is_array($tables)) { |
| 80 | 80 | $tables = [$tables]; |