@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param bool $immediate |
64 | 64 | * @return EntityQuery |
65 | 65 | */ |
66 | - public function query(string|array $with = [], bool $immediate = false): EntityQuery; |
|
66 | + public function query(string | array $with = [], bool $immediate = false): EntityQuery; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Load with relation |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @param bool $immediate |
72 | 72 | * @return $this |
73 | 73 | */ |
74 | - public function with(string|array $with, bool $immediate = false): self; |
|
74 | + public function with(string | array $with, bool $immediate = false): self; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Set order |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return $this |
81 | 81 | */ |
82 | 82 | public function orderBy( |
83 | - string|Closure|Expression|array $columns, |
|
83 | + string | Closure | Expression | array $columns, |
|
84 | 84 | string $order = 'ASC' |
85 | 85 | ): self; |
86 | 86 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @param string|array<string, mixed> $filters |
98 | 98 | * @return $this |
99 | 99 | */ |
100 | - public function filters(string|array $filters = []): self; |
|
100 | + public function filters(string | array $filters = []): self; |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Create the instance of Entity |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | * @param TEntity $entity |
112 | 112 | * @return array<mixed>|string|int|float|bool|null |
113 | 113 | */ |
114 | - public function save(Entity $entity): array|string|int|float|bool|null; |
|
114 | + public function save(Entity $entity): array | string | int | float | bool | null; |
|
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Save the new entity in data store |
118 | 118 | * @param TEntity $entity |
119 | 119 | * @return array<mixed>|string|int|float|false|null the primary key(s) value(s) |
120 | 120 | */ |
121 | - public function insert(Entity $entity): array|string|int|float|false|null; |
|
121 | + public function insert(Entity $entity): array | string | int | float | false | null; |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Update the existing entity in data store |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @return TEntity|null |
150 | 150 | */ |
151 | - public function find(array|string|int|float $id): ?Entity; |
|
151 | + public function find(array | string | int | float $id): ?Entity; |
|
152 | 152 | |
153 | 153 | /** |
154 | 154 | * Find one entity instance using some conditions |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * The order by column(s) |
84 | 84 | * @var string|Closure|Expression|string[]|Expression[]|Closure[] |
85 | 85 | */ |
86 | - protected string|Closure|Expression|array $orderColumns = ''; |
|
86 | + protected string | Closure | Expression | array $orderColumns = ''; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * The order direction |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * {@inheritedoc} |
125 | 125 | */ |
126 | - public function query(string|array $with = [], bool $immediate = false): EntityQuery |
|
126 | + public function query(string | array $with = [], bool $immediate = false): EntityQuery |
|
127 | 127 | { |
128 | 128 | if (is_string($with)) { |
129 | 129 | $with = [$with]; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | /** |
164 | 164 | * {@inheritedoc} |
165 | 165 | */ |
166 | - public function with(string|array $with, bool $immediate = false): self |
|
166 | + public function with(string | array $with, bool $immediate = false): self |
|
167 | 167 | { |
168 | 168 | if (!is_array($with)) { |
169 | 169 | $with = [$with]; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * {@inheritedoc} |
179 | 179 | */ |
180 | 180 | public function orderBy( |
181 | - string|Closure|Expression|array $columns, |
|
181 | + string | Closure | Expression | array $columns, |
|
182 | 182 | string $order = 'ASC' |
183 | 183 | ): self { |
184 | 184 | $this->orderColumns = $columns; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | /** |
202 | 202 | * {@inheritedoc} |
203 | 203 | */ |
204 | - public function filters(string|array $filters = []): self |
|
204 | + public function filters(string | array $filters = []): self |
|
205 | 205 | { |
206 | 206 | if (is_string($filters)) { |
207 | 207 | $filters = [$filters => true]; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * {@inheritedoc} |
243 | 243 | * @return TEntity|null |
244 | 244 | */ |
245 | - public function find(array|string|int|float $id): ?Entity |
|
245 | + public function find(array | string | int | float $id): ?Entity |
|
246 | 246 | { |
247 | 247 | return $this->query()->find($id); |
248 | 248 | } |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | /** |
283 | 283 | * {@inheritedoc} |
284 | 284 | */ |
285 | - public function save(Entity $entity): array|string|int|float|bool|null |
|
285 | + public function save(Entity $entity): array | string | int | float | bool | null |
|
286 | 286 | { |
287 | 287 | $data = Proxy::instance()->getEntityDataMapper($entity); |
288 | 288 | |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | /** |
297 | 297 | * {@inheritedoc} |
298 | 298 | */ |
299 | - public function insert(Entity $entity): array|string|int|float|false|null |
|
299 | + public function insert(Entity $entity): array | string | int | float | false | null |
|
300 | 300 | { |
301 | 301 | $data = Proxy::instance()->getEntityDataMapper($entity); |
302 | 302 | $mapper = $data->getEntityMapper(); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | |
313 | 313 | $connection = $this->manager->getConnection(); |
314 | - $id = $connection->transaction(function (Connection $connection) use ($data, $mapper) { |
|
314 | + $id = $connection->transaction(function(Connection $connection) use ($data, $mapper) { |
|
315 | 315 | $columns = $data->getRawColumns(); |
316 | 316 | $pkGenerator = $mapper->getPrimaryKeyGenerator(); |
317 | 317 | if ($pkGenerator !== null) { |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $modified = $data->getModifiedColumns(); |
382 | 382 | if (!empty($modified)) { |
383 | 383 | $connection = $this->manager->getConnection(); |
384 | - $result = $connection->transaction(function (Connection $connection) use ($data, $mapper, $modified) { |
|
384 | + $result = $connection->transaction(function(Connection $connection) use ($data, $mapper, $modified) { |
|
385 | 385 | $columns = array_intersect_key($data->getRawColumns(), array_flip($modified)); |
386 | 386 | |
387 | 387 | $updatedAt = null; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | $connection = $this->manager->getConnection(); |
421 | - return $connection->transaction(function (Connection $connection) use ($data) { |
|
421 | + return $connection->transaction(function(Connection $connection) use ($data) { |
|
422 | 422 | $data->executePendingLinkage(); |
423 | 423 | |
424 | 424 | return true; |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $eventsHandlers = $mapper->getEventHandlers(); |
436 | 436 | $connection = $this->manager->getConnection(); |
437 | 437 | |
438 | - $result = $connection->transaction(function () use ($data, $mapper, $force) { |
|
438 | + $result = $connection->transaction(function() use ($data, $mapper, $force) { |
|
439 | 439 | if ($data->isDeleted()) { |
440 | 440 | throw new EntityStateException('The record was deleted'); |
441 | 441 | } |