@@ -37,7 +37,7 @@ |
||
37 | 37 | $space = $this->mapper->getSpace($spaceId); |
38 | 38 | $tuple = $response->getBodyField(Keys::DATA)[0]; |
39 | 39 | $instance = $space->getInstance($tuple); |
40 | - $key = $spaceId . '/' . implode('/', $space->getKey($instance)); |
|
40 | + $key = $spaceId.'/'.implode('/', $space->getKey($instance)); |
|
41 | 41 | if (array_key_exists($key, $changes)) { |
42 | 42 | if ( |
43 | 43 | $changes[$key]->type == RequestTypes::getName(RequestTypes::INSERT) |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - public function find(Criteria|array|null $criteria = null, ?int $limit = null): array |
|
154 | + public function find(Criteria | array | null $criteria = null, ?int $limit = null): array |
|
155 | 155 | { |
156 | 156 | $criteria = $this->getCriteria($criteria, $limit); |
157 | 157 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return $result; |
174 | 174 | } |
175 | 175 | |
176 | - public function findOne(Criteria|array|null $criteria = null) |
|
176 | + public function findOne(Criteria | array | null $criteria = null) |
|
177 | 177 | { |
178 | 178 | $rows = $this->find($criteria, 1); |
179 | 179 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | return $instance; |
248 | 248 | } |
249 | 249 | |
250 | - public function findOrFail(Criteria|array|null $criteria = null) |
|
250 | + public function findOrFail(Criteria | array | null $criteria = null) |
|
251 | 251 | { |
252 | 252 | $one = $this->findOne($criteria); |
253 | 253 | if ($one) { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | return $this->class; |
263 | 263 | } |
264 | 264 | |
265 | - public function getCriteria(Criteria|array|null $criteria = null, ?int $limit = null): Criteria |
|
265 | + public function getCriteria(Criteria | array | null $criteria = null, ?int $limit = null): Criteria |
|
266 | 266 | { |
267 | 267 | if (!$criteria) { |
268 | 268 | $criteria = Criteria::allIterator(); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $this->indexes = $indexes; |
451 | 451 | } |
452 | 452 | |
453 | - public function update($instance, Operations|array $operations) |
|
453 | + public function update($instance, Operations | array $operations) |
|
454 | 454 | { |
455 | 455 | if (is_array($operations)) { |
456 | 456 | $data = $operations; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $changes = []; |
32 | 32 | foreach ($this->mappers as $prefix => $mapper) { |
33 | 33 | foreach ($mapper->getChanges() as $change) { |
34 | - $change->space = $prefix . '.' . $change->space; |
|
34 | + $change->space = $prefix.'.'.$change->space; |
|
35 | 35 | $changes[] = $change; |
36 | 36 | } |
37 | 37 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $this->mappers[$name]; |
50 | 50 | } |
51 | 51 | |
52 | - public function getSpace(object|int|string $name): Space |
|
52 | + public function getSpace(object | int | string $name): Space |
|
53 | 53 | { |
54 | 54 | if (is_object($name) && $this->spaceCasting) { |
55 | 55 | $callback = $this->spaceCasting; |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | |
10 | 10 | trait Api |
11 | 11 | { |
12 | - abstract public function getSpace(object|int|string $id): Space; |
|
12 | + abstract public function getSpace(object | int | string $id): Space; |
|
13 | 13 | |
14 | 14 | public function create(string $space, array $data) |
15 | 15 | { |
16 | 16 | return $this->getSpace($space)->create($data); |
17 | 17 | } |
18 | 18 | |
19 | - public function delete(object|string $space, array|object|null $instance = null) |
|
19 | + public function delete(object | string $space, array | object | null $instance = null) |
|
20 | 20 | { |
21 | 21 | if (is_object($space)) { |
22 | 22 | $instance = $space; |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | $this->getSpace($space)->delete($instance); |
25 | 25 | } |
26 | 26 | |
27 | - public function find(string $space, Criteria|array|null $query = null): array |
|
27 | + public function find(string $space, Criteria | array | null $query = null): array |
|
28 | 28 | { |
29 | 29 | return $this->getSpace($space)->find($query); |
30 | 30 | } |
31 | 31 | |
32 | - public function findOne(string $space, Criteria|array|null $query = null) |
|
32 | + public function findOne(string $space, Criteria | array | null $query = null) |
|
33 | 33 | { |
34 | 34 | return $this->getSpace($space)->findOne($query); |
35 | 35 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | return $this->getSpace($space)->findOrCreate($query, $params); |
40 | 40 | } |
41 | 41 | |
42 | - public function findOrFail(string $space, Criteria|array|null $query = null) |
|
42 | + public function findOrFail(string $space, Criteria | array | null $query = null) |
|
43 | 43 | { |
44 | 44 | return $this->getSpace($space)->findOrFail($query); |
45 | 45 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return $this->getSpace($space)->findOne(compact('id')); |
54 | 54 | } |
55 | 55 | |
56 | - public function update(string|object $space, object|array $instance, Operations|array|null $operations = null) |
|
56 | + public function update(string | object $space, object | array $instance, Operations | array | null $operations = null) |
|
57 | 57 | { |
58 | 58 | if (is_object($space)) { |
59 | 59 | [$instance, $operations] = [$space, $instance]; |
@@ -65,17 +65,17 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | if (!$createFunction) { |
68 | - $query = 'local ' . implode(', ', array_keys($params)) . ' = ...' . PHP_EOL . $query; |
|
68 | + $query = 'local '.implode(', ', array_keys($params)).' = ...'.PHP_EOL.$query; |
|
69 | 69 | return $this->client->evaluate($query, ...array_values($params)); |
70 | 70 | } |
71 | 71 | |
72 | - $name = 'evaluate_' . md5($query . json_encode(array_keys($params))); |
|
72 | + $name = 'evaluate_'.md5($query.json_encode(array_keys($params))); |
|
73 | 73 | try { |
74 | 74 | return $this->client->call($name, ...array_values($params)); |
75 | 75 | } catch (RequestFailed $e) { |
76 | 76 | if ($e->getMessage() == "Procedure '$name' is not defined") { |
77 | 77 | $body = implode(PHP_EOL, [ |
78 | - "function(" . implode(', ', array_keys($params)) . ")", |
|
78 | + "function(".implode(', ', array_keys($params)).")", |
|
79 | 79 | $query, |
80 | 80 | "end", |
81 | 81 | ]); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this->middleware->getChanges(); |
132 | 132 | } |
133 | 133 | |
134 | - public function getClassSpace(int|string $class): int|string |
|
134 | + public function getClassSpace(int | string $class): int | string |
|
135 | 135 | { |
136 | 136 | if (!is_integer($class) && !ctype_lower($class) && class_exists($class)) { |
137 | 137 | if (!array_key_exists($class, $this->classNames)) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | return $class; |
144 | 144 | } |
145 | 145 | |
146 | - public function getSpace(object|int|string $id): Space |
|
146 | + public function getSpace(object | int | string $id): Space |
|
147 | 147 | { |
148 | 148 | if (!count($this->spaces)) { |
149 | 149 | $this->setSchemaId(0); |