@@ -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) |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | $this->getSpace($space)->delete($instance); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function find(string $space, Criteria|array|null $query = null): array |
|
| 24 | + public function find(string $space, Criteria | array | null $query = null): array |
|
| 25 | 25 | { |
| 26 | 26 | return $this->getSpace($space)->find($query); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function findOne(string $space, Criteria|array|null $query = null) |
|
| 29 | + public function findOne(string $space, Criteria | array | null $query = null) |
|
| 30 | 30 | { |
| 31 | 31 | return $this->getSpace($space)->findOne($query); |
| 32 | 32 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return $this->getSpace($space)->findOrCreate($query, $params); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - public function findOrFail(string $space, Criteria|array|null $query = null) |
|
| 39 | + public function findOrFail(string $space, Criteria | array | null $query = null) |
|
| 40 | 40 | { |
| 41 | 41 | return $this->getSpace($space)->findOrFail($query); |
| 42 | 42 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return $this->getSpace($space)->findOne(compact('id')); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function update(string $space, $instance, Operations|array $operations) |
|
| 53 | + public function update(string $space, $instance, Operations | array $operations) |
|
| 54 | 54 | { |
| 55 | 55 | $this->getSpace($space)->update($instance, $operations); |
| 56 | 56 | } |
@@ -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; |