@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $instance = $this->createInstance(); |
52 | 52 | foreach ($data as $key => $value) { |
53 | 53 | if ($value instanceof Entity) { |
54 | - $value = $value->getRepository()->getSpace()->getIndex(0)->getValue($value->toArray()) ?: null; |
|
54 | + $value = $value->getRepository()->getSpace()->getIndex(0)->getValue($value->toArray()) ?: null; |
|
55 | 55 | } |
56 | 56 | $instance->$key = $value; |
57 | 57 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $index = $this->getSpace()->castIndex($params); |
91 | 91 | |
92 | 92 | if ($index === null) { |
93 | - throw new Exception("No index for params " . json_encode($params)); |
|
93 | + throw new Exception("No index for params ".json_encode($params)); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $criteria = Criteria::index($index->id) |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | $instance = $this->findOne($params); |
177 | 177 | if (!$instance) { |
178 | - throw new Exception("No " . $this->getSpace()->name . ' found using ' . json_encode($params)); |
|
178 | + throw new Exception("No ".$this->getSpace()->name.' found using '.json_encode($params)); |
|
179 | 179 | } |
180 | 180 | return $instance; |
181 | 181 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | $index = $space->castIndex($query ?: $params); |
17 | 17 | if ($index === null) { |
18 | - throw new Exception("No valid index for " . json_encode($params)); |
|
18 | + throw new Exception("No valid index for ".json_encode($params)); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $key = $space->getIndex(0)->getProperty()?->name; |
@@ -104,7 +104,7 @@ |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | if (!$suppressException) { |
107 | - throw new Exception("No index on " . $this->name . ' for [' . implode(', ', array_keys($params)) . ']'); |
|
107 | + throw new Exception("No index on ".$this->name.' for ['.implode(', ', array_keys($params)).']'); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return null; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | if (!in_array($options['engine'], ['memtx', 'vinyl'])) { |
41 | - throw new Exception("Invalid engine " . $options['engine']); |
|
41 | + throw new Exception("Invalid engine ".$options['engine']); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | [$id] = $this->mapper->getClient()->evaluate(" |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return $meta; |
97 | 97 | } |
98 | 98 | |
99 | - public function getSpace(int|string $id): Space |
|
99 | + public function getSpace(int | string $id): Space |
|
100 | 100 | { |
101 | 101 | if (is_string($id)) { |
102 | 102 | foreach ($this->meta as $row) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | public function once(string $name, Closure $callback) |
144 | 144 | { |
145 | - $key = 'mapper-once' . $name; |
|
145 | + $key = 'mapper-once'.$name; |
|
146 | 146 | $row = $this->mapper->findOne('_schema', ['key' => $key]); |
147 | 147 | if (!$row) { |
148 | 148 | $this->mapper->create('_schema', ['key' => $key]); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | public function revert(string $name): bool |
169 | 169 | { |
170 | - $key = 'mapper-once' . $name; |
|
170 | + $key = 'mapper-once'.$name; |
|
171 | 171 | $row = $this->mapper->findOne('_schema', ['key' => $key]); |
172 | 172 | if ($row) { |
173 | 173 | $this->mapper->remove($row); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $tags = $description->getTags('var'); |
160 | 160 | |
161 | 161 | if (!count($tags)) { |
162 | - throw new Exception("No var tag for " . $entity . '::' . $property->getName()); |
|
162 | + throw new Exception("No var tag for ".$entity.'::'.$property->getName()); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | $byTypes = []; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | if (!array_key_exists('var', $byTypes)) { |
171 | - throw new Exception("No var tag for " . $entity . '::' . $property->getName()); |
|
171 | + throw new Exception("No var tag for ".$entity.'::'.$property->getName()); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $propertyName = $property->getName(); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $space->createIndex($index); |
240 | 240 | } catch (Exception $e) { |
241 | 241 | $presentation = json_encode($properties['indexes'][$i]); |
242 | - throw new Exception("Failed to add index $presentation. " . $e->getMessage(), 0, $e); |
|
242 | + throw new Exception("Failed to add index $presentation. ".$e->getMessage(), 0, $e); |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } |
251 | 251 | if (!count($space->getIndexes())) { |
252 | 252 | if (!$space->hasProperty('id')) { |
253 | - throw new Exception("No primary index on " . $space->getName()); |
|
253 | + throw new Exception("No primary index on ".$space->getName()); |
|
254 | 254 | } |
255 | 255 | $space->addIndex(['id']); |
256 | 256 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | - if (array_key_exists($name . '_seq', $this->sequences)) { |
|
45 | + if (array_key_exists($name.'_seq', $this->sequences)) { |
|
46 | 46 | // use tarantool standard sequence name |
47 | 47 | return; |
48 | 48 | } |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | |
67 | 67 | $name = $space->name; |
68 | 68 | if (!array_key_exists($name, $this->sequences)) { |
69 | - if (array_key_exists($name . '_seq', $this->sequences)) { |
|
69 | + if (array_key_exists($name.'_seq', $this->sequences)) { |
|
70 | 70 | // use tarantool standard sequence name |
71 | 71 | $name .= '_seq'; |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - $next = $this->mapper->getClient()->call('box.sequence.' . $name . ':next'); |
|
75 | + $next = $this->mapper->getClient()->call('box.sequence.'.$name.':next'); |
|
76 | 76 | |
77 | 77 | return $next[0]; |
78 | 78 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if ($this->gettersCache[$name] == 'exception') { |
52 | - throw new BadMethodCallException("Call to undefined method " . get_class($this) . '::' . $name); |
|
52 | + throw new BadMethodCallException("Call to undefined method ".get_class($this).'::'.$name); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | [$method, $space, $key, $field] = $this->gettersCache[$name]; |