@@ -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 | if (!$criteria) { |
| 157 | 157 | $criteria = Criteria::allIterator(); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | return $result; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - public function findOne(Criteria|array|null $criteria = null) |
|
| 187 | + public function findOne(Criteria | array | null $criteria = null) |
|
| 188 | 188 | { |
| 189 | 189 | $rows = $this->find($criteria, 1); |
| 190 | 190 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | return $this->getInstance($tuple); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - public function findOrFail(Criteria|array|null $criteria = null) |
|
| 243 | + public function findOrFail(Criteria | array | null $criteria = null) |
|
| 244 | 244 | { |
| 245 | 245 | $one = $this->findOne($criteria); |
| 246 | 246 | if ($one) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | $this->indexes = $indexes; |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | - public function update($instance, Operations|array $operations) |
|
| 423 | + public function update($instance, Operations | array $operations) |
|
| 424 | 424 | { |
| 425 | 425 | if (is_array($operations)) { |
| 426 | 426 | $data = $operations; |