@@ -90,7 +90,7 @@ |
||
90 | 90 | |
91 | 91 | public function once($name, $callback) |
92 | 92 | { |
93 | - $key = 'once' . $name; |
|
93 | + $key = 'once'.$name; |
|
94 | 94 | |
95 | 95 | $rows = $this->mapper->find('_schema', ['key' => $key]); |
96 | 96 | if (!count($rows)) { |
@@ -113,7 +113,7 @@ |
||
113 | 113 | if (!$this->getPropertyType($property)) { |
114 | 114 | throw new Exception("Unknown property $property", 1); |
115 | 115 | } |
116 | - $options['parts'][] = $this->getPropertyIndex($property)+1; |
|
116 | + $options['parts'][] = $this->getPropertyIndex($property) + 1; |
|
117 | 117 | $options['parts'][] = $this->getPropertyType($property); |
118 | 118 | } |
119 | 119 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function addPlugin($class) |
21 | 21 | { |
22 | 22 | if (!is_subclass_of($class, Plugin::class)) { |
23 | - throw new Exception("Plugin should extend " . Plugin::class . " class"); |
|
23 | + throw new Exception("Plugin should extend ".Plugin::class." class"); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $plugin = is_object($class) ? $class : new $class($this); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | if (!is_object($migration)) { |
25 | 25 | $migration = new $migration; |
26 | 26 | } |
27 | - $schema->once(get_class($migration), function () use ($migration) { |
|
27 | + $schema->once(get_class($migration), function() use ($migration) { |
|
28 | 28 | $migration->migrate($this->mapper); |
29 | 29 | }); |
30 | 30 | } |
@@ -118,7 +118,7 @@ |
||
118 | 118 | foreach ($schema->getSpaces() as $space) { |
119 | 119 | if (!count($space->getIndexes())) { |
120 | 120 | if (!$space->hasProperty('id')) { |
121 | - throw new Exception("No primary index on ". $space->getName()); |
|
121 | + throw new Exception("No primary index on ".$space->getName()); |
|
122 | 122 | } |
123 | 123 | $space->addIndex(['id']); |
124 | 124 | } |
@@ -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; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function disableRequest($class) |
26 | 26 | { |
27 | 27 | if (!is_subclass_of($class, Request::class)) { |
28 | - throw new Exception("Invalid request type: " . $class); |
|
28 | + throw new Exception("Invalid request type: ".$class); |
|
29 | 29 | } |
30 | 30 | $this->disabledRequests[] = $class; |
31 | 31 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function sendRequest(Request $request) |
34 | 34 | { |
35 | 35 | if (in_array(get_class($request), $this->disabledRequests)) { |
36 | - throw new Exception(get_class($request) . ' is disabled'); |
|
36 | + throw new Exception(get_class($request).' is disabled'); |
|
37 | 37 | } |
38 | 38 | $start = microtime(1); |
39 | 39 | $response = parent::sendRequest($request); |
@@ -51,12 +51,12 @@ |
||
51 | 51 | $old_entity = $repository->getOriginal($entity); |
52 | 52 | |
53 | 53 | foreach (['group'] as $field) { |
54 | - if ($old_entity[$map->$field-1] != $entity->$field) { |
|
54 | + if ($old_entity[$map->$field - 1] != $entity->$field) { |
|
55 | 55 | throw new \Exception(ucfirst($field)." can't be changed"); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - if ($old_entity[$map->parent-1] != $entity->parent) { |
|
59 | + if ($old_entity[$map->parent - 1] != $entity->parent) { |
|
60 | 60 | $leftValue = $entity->left; |
61 | 61 | $rightValue = $entity->right; |
62 | 62 | $toRoot = $entity->parent == 0 ? 1 : 0; |