@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | if (!is_subclass_of($class, Entity::class)) { |
39 | - throw new Exception("Entity should extend " . Entity::class . " class"); |
|
39 | + throw new Exception("Entity should extend ".Entity::class." class"); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->entityMapping[$space] = $class; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | if (!is_subclass_of($class, Repository::class)) { |
54 | - throw new Exception("Repository should extend " . Repository::class . " class"); |
|
54 | + throw new Exception("Repository should extend ".Repository::class." class"); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | $this->repositoryMapping[$space] = $class; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | unset($this->mappers[$name]); |
51 | 51 | } |
52 | 52 | foreach ($this->repositories as $space => $repository) { |
53 | - if (strpos($space, $name . '.') !== false) { |
|
53 | + if (strpos($space, $name.'.') !== false) { |
|
54 | 54 | unset($this->repositories[$space]); |
55 | 55 | } |
56 | 56 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function getPlugin($mixed) |
23 | 23 | { |
24 | 24 | if (!is_subclass_of($mixed, Plugin::class)) { |
25 | - throw new Exception("Plugin should extend " . Plugin::class . " class"); |
|
25 | + throw new Exception("Plugin should extend ".Plugin::class." class"); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $plugin = is_object($mixed) ? $mixed : new $mixed($this); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | if ($plugin == $mixed && array_key_exists($class, $this->plugins)) { |
32 | 32 | // overwrite plugin instance |
33 | - throw new Exception($class . ' is registered'); |
|
33 | + throw new Exception($class.' is registered'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | if (!array_key_exists($class, $this->plugins)) { |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | private function getTimestamp($string) |
506 | 506 | { |
507 | 507 | if (Carbon::hasTestNow() || !array_key_exists($string, $this->timestamps)) { |
508 | - if (strlen('' . $string) == 8 && is_numeric($string)) { |
|
508 | + if (strlen(''.$string) == 8 && is_numeric($string)) { |
|
509 | 509 | $value = Carbon::createFromFormat('Ymd', $string)->setTime(0, 0, 0)->timestamp; |
510 | 510 | } else { |
511 | 511 | $value = Carbon::parse($string)->timestamp; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $this->mapper->getPlugin(Sequence::class); |
550 | 550 | } |
551 | 551 | |
552 | - $this->mapper->getSchema()->once(__CLASS__ . '@entity', function (Mapper $mapper) { |
|
552 | + $this->mapper->getSchema()->once(__CLASS__.'@entity', function(Mapper $mapper) { |
|
553 | 553 | $this->mapper->getSchema() |
554 | 554 | ->createSpace('_temporal_entity', [ |
555 | 555 | 'id' => 'unsigned', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function register($class) |
36 | 36 | { |
37 | 37 | if (!is_subclass_of($class, BaseProcedure::class)) { |
38 | - throw new Exception("Procedure should extend " . BaseProcedure::class . ' class'); |
|
38 | + throw new Exception("Procedure should extend ".BaseProcedure::class.' class'); |
|
39 | 39 | } |
40 | 40 | $this->initSchema(); |
41 | 41 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | private function initSchema() |
71 | 71 | { |
72 | - $this->mapper->getSchema()->once(__CLASS__, function ($mapper) { |
|
72 | + $this->mapper->getSchema()->once(__CLASS__, function($mapper) { |
|
73 | 73 | $mapper->getSchema() |
74 | 74 | ->createSpace('_procedure') |
75 | 75 | ->addProperties([ |
@@ -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', |
@@ -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 | } |
@@ -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 | } |