@@ -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); |