@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | 51 | $changes = $mapper->find('_temporal_reference', $params); |
| 52 | - $states = $this->generateStates($changes, function ($state, $change) { |
|
| 52 | + $states = $this->generateStates($changes, function($state, $change) { |
|
| 53 | 53 | $state->data = $change->targetId; |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | 'targetId' => $entityId, |
| 81 | 81 | 'entity' => $params['entity'], |
| 82 | 82 | ]); |
| 83 | - $aggregates = $this->generateStates($changes, function ($state, $change) { |
|
| 83 | + $aggregates = $this->generateStates($changes, function($state, $change) { |
|
| 84 | 84 | if (!in_array($change->id, $state->data)) { |
| 85 | 85 | $state->data[] = $change->id; |
| 86 | 86 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | ]; |
| 270 | 270 | |
| 271 | 271 | $changes = $mapper->find('_temporal_override', $params); |
| 272 | - $states = $this->generateStates($changes, function ($state, $change) { |
|
| 272 | + $states = $this->generateStates($changes, function($state, $change) { |
|
| 273 | 273 | $state->data = array_merge($state->data, $change->data); |
| 274 | 274 | $state->exists = false; |
| 275 | 275 | }); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | throw new InvalidArgumentException("Nothing to initialize"); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - $method = 'init' . ucfirst($name); |
|
| 26 | + $method = 'init'.ucfirst($name); |
|
| 27 | 27 | if (!method_exists($this, $method)) { |
| 28 | 28 | throw new InvalidArgumentException("No initializer for $name"); |
| 29 | 29 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | private function initLink() |
| 35 | 35 | { |
| 36 | - $this->mapper->getSchema()->once(__CLASS__ . '@link', function (Mapper $mapper) { |
|
| 36 | + $this->mapper->getSchema()->once(__CLASS__.'@link', function(Mapper $mapper) { |
|
| 37 | 37 | $mapper->getSchema() |
| 38 | 38 | ->createSpace('_temporal_link', [ |
| 39 | 39 | 'id' => 'unsigned', |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | ->addIndex(['entity', 'id', 'begin']); |
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | - $this->mapper->getSchema()->once(__CLASS__ . '@link-idle', function (Mapper $mapper) { |
|
| 67 | + $this->mapper->getSchema()->once(__CLASS__.'@link-idle', function(Mapper $mapper) { |
|
| 68 | 68 | $mapper->getSchema()->getSpace('_temporal_link')->addProperty('idle', 'unsigned'); |
| 69 | 69 | }); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | private function initOverride() |
| 73 | 73 | { |
| 74 | - $this->mapper->getSchema()->once(__CLASS__ . '@states', function (Mapper $mapper) { |
|
| 74 | + $this->mapper->getSchema()->once(__CLASS__.'@states', function(Mapper $mapper) { |
|
| 75 | 75 | $mapper->getSchema() |
| 76 | 76 | ->createSpace('_temporal_override', [ |
| 77 | 77 | 'entity' => 'unsigned', |
@@ -95,14 +95,14 @@ discard block |
||
| 95 | 95 | ->addIndex(['entity', 'id', 'begin']); |
| 96 | 96 | }); |
| 97 | 97 | |
| 98 | - $this->mapper->getSchema()->once(__CLASS__ . '@override-idle', function (Mapper $mapper) { |
|
| 98 | + $this->mapper->getSchema()->once(__CLASS__.'@override-idle', function(Mapper $mapper) { |
|
| 99 | 99 | $mapper->getSchema()->getSpace('_temporal_override')->addProperty('idle', 'unsigned'); |
| 100 | 100 | }); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | private function initReference() |
| 104 | 104 | { |
| 105 | - $this->mapper->getSchema()->once(__CLASS__ . '@reference', function (Mapper $mapper) { |
|
| 105 | + $this->mapper->getSchema()->once(__CLASS__.'@reference', function(Mapper $mapper) { |
|
| 106 | 106 | $mapper->getSchema() |
| 107 | 107 | ->createSpace('_temporal_reference', [ |
| 108 | 108 | 'idle' => 'unsigned', |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (!in_array($options['engine'], ['memtx', 'vinyl'])) { |
| 44 | - throw new Exception("Invalid engine " . $options['engine']); |
|
| 44 | + throw new Exception("Invalid engine ".$options['engine']); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | [$id] = $this->mapper->getClient()->evaluate(" |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | public function once(string $name, Closure $callback) |
| 163 | 163 | { |
| 164 | - $key = 'mapper-once' . $name; |
|
| 164 | + $key = 'mapper-once'.$name; |
|
| 165 | 165 | $row = $this->mapper->findOne('_schema', ['key' => $key]); |
| 166 | 166 | if (!$row) { |
| 167 | 167 | $this->mapper->create('_schema', ['key' => $key]); |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | public function forgetOnce(string $name) |
| 173 | 173 | { |
| 174 | - $key = 'mapper-once' . $name; |
|
| 174 | + $key = 'mapper-once'.$name; |
|
| 175 | 175 | $row = $this->mapper->findOne('_schema', ['key' => $key]); |
| 176 | 176 | if ($row) { |
| 177 | 177 | $this->mapper->remove($row); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | if (!is_object($migration)) { |
| 34 | 34 | $migration = new $migration(); |
| 35 | 35 | } |
| 36 | - $schema->once(get_class($migration), function () use ($migration) { |
|
| 36 | + $schema->once(get_class($migration), function() use ($migration) { |
|
| 37 | 37 | $migration->migrate($this->mapper); |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | foreach ($this->keys as $_) { |
| 89 | 89 | if ($this->keys[$_] == $key) { |
| 90 | - throw new Exception($this->space->getName() . ' ' . json_encode($key) . ' exists'); |
|
| 90 | + throw new Exception($this->space->getName().' '.json_encode($key).' exists'); |
|
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $entity = $this->findOne($params); |
| 152 | 152 | if (!$entity) { |
| 153 | - throw new Exception("No " . $this->getSpace()->getName() . ' found using ' . json_encode($params)); |
|
| 153 | + throw new Exception("No ".$this->getSpace()->getName().' found using '.json_encode($params)); |
|
| 154 | 154 | } |
| 155 | 155 | return $entity; |
| 156 | 156 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $space = $this->space; |
| 199 | 199 | $index = $space->castIndex($params); |
| 200 | 200 | if ($index === null) { |
| 201 | - throw new Exception("No index for params " . json_encode($params)); |
|
| 201 | + throw new Exception("No index for params ".json_encode($params)); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $criteria = Criteria::index($index) |