@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * |
| 111 | 111 | * @throws BuilderException |
| 112 | 112 | */ |
| 113 | - public function insertOne(array $rowset = []): int|string|null |
|
| 113 | + public function insertOne(array $rowset = []): int | string | null |
|
| 114 | 114 | { |
| 115 | 115 | return $this->database |
| 116 | 116 | ->insert($this->name) |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | if ($driverObject instanceof LoggerAwareInterface) { |
| 162 | 162 | $logger = $this->getLoggerForDriver($driverObject); |
| 163 | - if (! $logger instanceof NullLogger) { |
|
| 163 | + if (!$logger instanceof NullLogger) { |
|
| 164 | 164 | $driverObject->setLogger($logger); |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | private function getLoggerForDriver(DriverInterface $driver): LoggerInterface |
| 200 | 200 | { |
| 201 | - if (! $this->loggerFactory) { |
|
| 201 | + if (!$this->loggerFactory) { |
|
| 202 | 202 | return $this->logger ??= new NullLogger(); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | protected array $tables = []; |
| 46 | 46 | protected array $unionTokens = []; |
| 47 | - protected bool|string|array $distinct = false; |
|
| 47 | + protected bool | string | array $distinct = false; |
|
| 48 | 48 | protected array $columns = ['*']; |
| 49 | 49 | /** @var string[][]|FragmentInterface[][] */ |
| 50 | 50 | protected array $orderBy = []; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param bool|string|FragmentInterface $distinct You are only allowed to use string value for |
| 73 | 73 | * Postgres databases. |
| 74 | 74 | */ |
| 75 | - public function distinct(bool|string|FragmentInterface $distinct = true): SelectQuery |
|
| 75 | + public function distinct(bool | string | FragmentInterface $distinct = true): SelectQuery |
|
| 76 | 76 | { |
| 77 | 77 | $this->distinct = $distinct; |
| 78 | 78 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @param string|array $expression |
| 134 | 134 | * @param string $direction Sorting direction, ASC|DESC. |
| 135 | 135 | */ |
| 136 | - public function orderBy(string|FragmentInterface|array $expression, string $direction = self::SORT_ASC): SelectQuery |
|
| 136 | + public function orderBy(string | FragmentInterface | array $expression, string $direction = self::SORT_ASC): SelectQuery |
|
| 137 | 137 | { |
| 138 | 138 | if (!\is_array($expression)) { |
| 139 | 139 | $this->addOrder($expression, $direction); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | /** |
| 151 | 151 | * Column or expression to group query by. |
| 152 | 152 | */ |
| 153 | - public function groupBy(string|Fragment|Expression $expression): SelectQuery |
|
| 153 | + public function groupBy(string | Fragment | Expression $expression): SelectQuery |
|
| 154 | 154 | { |
| 155 | 155 | $this->groupBy[] = $expression; |
| 156 | 156 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | * @param string $order Sorting direction, ASC|DESC. |
| 355 | 355 | * @return self|$this |
| 356 | 356 | */ |
| 357 | - private function addOrder(string|FragmentInterface $field, string $order): SelectQuery |
|
| 357 | + private function addOrder(string | FragmentInterface $field, string $order): SelectQuery |
|
| 358 | 358 | { |
| 359 | 359 | if (!\is_string($field)) { |
| 360 | 360 | $this->orderBy[] = [$field, $order]; |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | */ |
| 105 | 105 | private function whereWrapper(): Closure |
| 106 | 106 | { |
| 107 | - return static function ($parameter) { |
|
| 107 | + return static function($parameter) { |
|
| 108 | 108 | \is_array($parameter) and throw new BuilderException('Arrays must be wrapped with Parameter instance'); |
| 109 | 109 | |
| 110 | 110 | return !$parameter instanceof ParameterInterface && !$parameter instanceof FragmentInterface |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | /** |
| 64 | 64 | * Name/id of last join, every ON and ON WHERE call will be associated with this join. |
| 65 | 65 | */ |
| 66 | - private int|string|null $lastJoin = null; |
|
| 66 | + private int | string | null $lastJoin = null; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Register new JOIN with specified type with set of on conditions (linking one table to |
@@ -78,8 +78,8 @@ discard block |
||
| 78 | 78 | * @throws BuilderException |
| 79 | 79 | */ |
| 80 | 80 | public function join( |
| 81 | - ActiveQuery|string $type, |
|
| 82 | - string|ActiveQuery $outer, |
|
| 81 | + ActiveQuery | string $type, |
|
| 82 | + string | ActiveQuery $outer, |
|
| 83 | 83 | string $alias = null, |
| 84 | 84 | mixed $on = null |
| 85 | 85 | ): self { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @throws BuilderException |
| 115 | 115 | */ |
| 116 | - public function innerJoin(ActiveQuery|string $outer, string $alias = null): self |
|
| 116 | + public function innerJoin(ActiveQuery | string $outer, string $alias = null): self |
|
| 117 | 117 | { |
| 118 | 118 | $this->joinTokens[++$this->lastJoin] = [ |
| 119 | 119 | 'outer' => $outer, |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * |
| 140 | 140 | * @throws BuilderException |
| 141 | 141 | */ |
| 142 | - public function rightJoin(ActiveQuery|string $outer, string $alias = null, mixed $on = null): self |
|
| 142 | + public function rightJoin(ActiveQuery | string $outer, string $alias = null, mixed $on = null): self |
|
| 143 | 143 | { |
| 144 | 144 | $this->joinTokens[++$this->lastJoin] = [ |
| 145 | 145 | 'outer' => $outer, |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * |
| 165 | 165 | * @throws BuilderException |
| 166 | 166 | */ |
| 167 | - public function leftJoin(ActiveQuery|string $outer, string $alias = null): self |
|
| 167 | + public function leftJoin(ActiveQuery | string $outer, string $alias = null): self |
|
| 168 | 168 | { |
| 169 | 169 | $this->joinTokens[++$this->lastJoin] = [ |
| 170 | 170 | 'outer' => $outer, |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * |
| 192 | 192 | * @return $this |
| 193 | 193 | */ |
| 194 | - public function fullJoin(ActiveQuery|string $outer, string $alias = null): self |
|
| 194 | + public function fullJoin(ActiveQuery | string $outer, string $alias = null): self |
|
| 195 | 195 | { |
| 196 | 196 | $this->joinTokens[++$this->lastJoin] = [ |
| 197 | 197 | 'outer' => $outer, |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | private function onWrapper(): Closure |
| 353 | 353 | { |
| 354 | - return static fn ($parameter) => |
|
| 354 | + return static fn($parameter) => |
|
| 355 | 355 | $parameter instanceof FragmentInterface || $parameter instanceof ParameterInterface |
| 356 | 356 | ? $parameter |
| 357 | 357 | : new Expression($parameter); |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | */ |
| 363 | 363 | private function onWhereWrapper(): Closure |
| 364 | 364 | { |
| 365 | - return static function ($parameter) { |
|
| 365 | + return static function($parameter) { |
|
| 366 | 366 | \is_array($parameter) and throw new BuilderException('Arrays must be wrapped with Parameter instance'); |
| 367 | 367 | |
| 368 | 368 | //Wrapping all values with ParameterInterface |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | */ |
| 101 | 101 | private function havingWrapper(): Closure |
| 102 | 102 | { |
| 103 | - return static function ($parameter) { |
|
| 103 | + return static function($parameter) { |
|
| 104 | 104 | \is_array($parameter) and throw new BuilderException('Arrays must be wrapped with Parameter instance'); |
| 105 | 105 | |
| 106 | 106 | return !$parameter instanceof ParameterInterface && !$parameter instanceof FragmentInterface |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * $insert->columns("name", "email"); |
| 49 | 49 | * $insert->columns("name, email"); |
| 50 | 50 | */ |
| 51 | - public function columns(array|string ...$columns): InsertQuery |
|
| 51 | + public function columns(array | string ...$columns): InsertQuery |
|
| 52 | 52 | { |
| 53 | 53 | $this->columns = $this->fetchIdentifiers($columns); |
| 54 | 54 | |
@@ -236,8 +236,8 @@ |
||
| 236 | 236 | */ |
| 237 | 237 | protected function formatDatetime( |
| 238 | 238 | string $type, |
| 239 | - string|int|\DateTimeInterface $value |
|
| 240 | - ): \DateTimeInterface|FragmentInterface|string { |
|
| 239 | + string | int | \DateTimeInterface $value |
|
| 240 | + ): \DateTimeInterface | FragmentInterface | string { |
|
| 241 | 241 | if ($value === 'current_timestamp()') { |
| 242 | 242 | $value = self::DATETIME_NOW; |
| 243 | 243 | } |
@@ -228,7 +228,7 @@ |
||
| 228 | 228 | * |
| 229 | 229 | * @psalm-return non-empty-string |
| 230 | 230 | */ |
| 231 | - protected function identify(AbstractTable|ElementInterface|string $element): string |
|
| 231 | + protected function identify(AbstractTable | ElementInterface | string $element): string |
|
| 232 | 232 | { |
| 233 | 233 | if (\is_string($element)) { |
| 234 | 234 | return $this->driver->identifier($element); |