@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | return $this->getSpace($space)->create($data); |
15 | 15 | } |
16 | 16 | |
17 | - public function find(string $space, Criteria|array|null $query = null): array |
|
17 | + public function find(string $space, Criteria | array | null $query = null): array |
|
18 | 18 | { |
19 | 19 | return $this->getSpace($space)->find($query); |
20 | 20 | } |
21 | 21 | |
22 | - public function findOne(string $space, Criteria|array|null $query = null) |
|
22 | + public function findOne(string $space, Criteria | array | null $query = null) |
|
23 | 23 | { |
24 | 24 | return $this->getSpace($space)->findOne($query); |
25 | 25 | } |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | return $this->getSpace($space)->findOrCreate($query, $params); |
30 | 30 | } |
31 | 31 | |
32 | - public function findOrFail(string $space, Criteria|array|null $query = null) |
|
32 | + public function findOrFail(string $space, Criteria | array | null $query = null) |
|
33 | 33 | { |
34 | 34 | return $this->getSpace($space)->findOrFail($query); |
35 | 35 | } |
36 | 36 | |
37 | - public function update(string $space, $instance, Operations|array $operations) |
|
37 | + public function update(string $space, $instance, Operations | array $operations) |
|
38 | 38 | { |
39 | 39 | $this->getSpace($space)->update($instance, $operations); |
40 | 40 | } |
@@ -48,17 +48,17 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if (!$createFunction) { |
51 | - $query = 'local ' . implode(', ', array_keys($params)) . ' = ...' . PHP_EOL . $query; |
|
51 | + $query = 'local '.implode(', ', array_keys($params)).' = ...'.PHP_EOL.$query; |
|
52 | 52 | return $this->client->evaluate($query, ...array_values($params)); |
53 | 53 | } |
54 | 54 | |
55 | - $name = 'evaluate_' . md5($query . json_encode(array_keys($params))); |
|
55 | + $name = 'evaluate_'.md5($query.json_encode(array_keys($params))); |
|
56 | 56 | try { |
57 | 57 | return $this->client->call($name, ...array_values($params)); |
58 | 58 | } catch (RequestFailed $e) { |
59 | 59 | if ($e->getMessage() == "Procedure '$name' is not defined") { |
60 | 60 | $body = implode(PHP_EOL, [ |
61 | - "function(" . implode(', ', array_keys($params)) . ")", |
|
61 | + "function(".implode(', ', array_keys($params)).")", |
|
62 | 62 | $query, |
63 | 63 | "end", |
64 | 64 | ]); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return $this->middleware->getChanges(); |
115 | 115 | } |
116 | 116 | |
117 | - public function getSpace(int|string $id): Space |
|
117 | + public function getSpace(int | string $id): Space |
|
118 | 118 | { |
119 | 119 | if (!count($this->spaces)) { |
120 | 120 | $this->setSchemaId(0); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $changes = []; |
21 | 21 | foreach ($this->mappers as $prefix => $mapper) { |
22 | 22 | foreach ($mapper->getChanges() as $change) { |
23 | - $change->space = $prefix . '.' . $change->space; |
|
23 | + $change->space = $prefix.'.'.$change->space; |
|
24 | 24 | $changes[] = $change; |
25 | 25 | } |
26 | 26 | } |
@@ -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) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->mapper->client->call("box.sequence.$this->name:drop"); |
117 | 117 | } |
118 | 118 | |
119 | - public function find(Criteria|array|null $criteria = null, ?int $limit = null): array |
|
119 | + public function find(Criteria | array | null $criteria = null, ?int $limit = null): array |
|
120 | 120 | { |
121 | 121 | if (!$criteria) { |
122 | 122 | $criteria = Criteria::allIterator(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | return array_map($this->getInstance(...), $tuples); |
136 | 136 | } |
137 | 137 | |
138 | - public function findOne(Criteria|array|null $criteria = null) |
|
138 | + public function findOne(Criteria | array | null $criteria = null) |
|
139 | 139 | { |
140 | 140 | $rows = $this->find($criteria, 1); |
141 | 141 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | return $this->getInstance($tuple); |
191 | 191 | } |
192 | 192 | |
193 | - public function findOrFail(Criteria|array|null $criteria = null) |
|
193 | + public function findOrFail(Criteria | array | null $criteria = null) |
|
194 | 194 | { |
195 | 195 | $one = $this->findOne($criteria); |
196 | 196 | if ($one) { |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | foreach ($indexes as $n => $index) { |
353 | 353 | $indexes[$n]['fields'] = []; |
354 | 354 | foreach ($index['parts'] as $part) { |
355 | - if (array_key_exists('field', $part)){ |
|
355 | + if (array_key_exists('field', $part)) { |
|
356 | 356 | $indexes[$n]['fields'][] = $this->fields[$part['field']]; |
357 | 357 | } else { |
358 | 358 | $indexes[$n]['fields'][] = $this->fields[$part[0]]; |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $this->indexes = $indexes; |
363 | 363 | } |
364 | 364 | |
365 | - public function update($instance, Operations|array $operations) |
|
365 | + public function update($instance, Operations | array $operations) |
|
366 | 366 | { |
367 | 367 | if (is_array($operations)) { |
368 | 368 | $data = $operations; |