@@ -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) |
@@ -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; |
@@ -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); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | - public function find(Criteria|array|null $criteria = null, ?int $limit = null): array |
|
162 | + public function find(Criteria | array | null $criteria = null, ?int $limit = null): array |
|
163 | 163 | { |
164 | 164 | $criteria = $this->getCriteria($criteria, $limit); |
165 | 165 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return $result; |
182 | 182 | } |
183 | 183 | |
184 | - public function findOne(Criteria|array|null $criteria = null) |
|
184 | + public function findOne(Criteria | array | null $criteria = null) |
|
185 | 185 | { |
186 | 186 | $rows = $this->find($criteria, 1); |
187 | 187 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | return $instance; |
256 | 256 | } |
257 | 257 | |
258 | - public function findOrFail(Criteria|array|null $criteria = null) |
|
258 | + public function findOrFail(Criteria | array | null $criteria = null) |
|
259 | 259 | { |
260 | 260 | $one = $this->findOne($criteria); |
261 | 261 | if ($one) { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | return $this->class; |
271 | 271 | } |
272 | 272 | |
273 | - public function getCriteria(Criteria|array|null $criteria = null, ?int $limit = null): Criteria |
|
273 | + public function getCriteria(Criteria | array | null $criteria = null, ?int $limit = null): Criteria |
|
274 | 274 | { |
275 | 275 | if (!$criteria) { |
276 | 276 | $criteria = Criteria::allIterator(); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | $this->indexes = $indexes; |
459 | 459 | } |
460 | 460 | |
461 | - public function update($instance, Operations|array $operations) |
|
461 | + public function update($instance, Operations | array $operations) |
|
462 | 462 | { |
463 | 463 | if (is_array($operations)) { |
464 | 464 | foreach ($this->format as $field) { |
@@ -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 | return $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]; |