@@ -31,6 +31,9 @@ |
||
| 31 | 31 | return $response; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param double $start |
|
| 36 | + */ |
|
| 34 | 37 | private function log($start, $class, $request = [], $response = []) |
| 35 | 38 | { |
| 36 | 39 | if ($this->logging) { |
@@ -28,6 +28,9 @@ discard block |
||
| 28 | 28 | return $plugin; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param string $space |
|
| 33 | + */ |
|
| 31 | 34 | public function create($space, $data) |
| 32 | 35 | { |
| 33 | 36 | $instance = $this->getRepository($space)->create($data); |
@@ -35,11 +38,17 @@ discard block |
||
| 35 | 38 | return $instance; |
| 36 | 39 | } |
| 37 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $space |
|
| 43 | + */ |
|
| 38 | 44 | public function findOne($space, $params = []) |
| 39 | 45 | { |
| 40 | 46 | return $this->getRepository($space)->findOne($params); |
| 41 | 47 | } |
| 42 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $space |
|
| 51 | + */ |
|
| 43 | 52 | public function find($space, $params = []) |
| 44 | 53 | { |
| 45 | 54 | return $this->getRepository($space)->find($params); |
@@ -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); |
@@ -259,6 +259,9 @@ |
||
| 259 | 259 | $this->results = []; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | + /** |
|
| 263 | + * @param Entity $instance |
|
| 264 | + */ |
|
| 262 | 265 | public function save($instance) |
| 263 | 266 | { |
| 264 | 267 | $tuple = []; |
@@ -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 | |
@@ -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 | } |
@@ -185,6 +185,9 @@ |
||
| 185 | 185 | |
| 186 | 186 | private $underscores = []; |
| 187 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $input |
|
| 190 | + */ |
|
| 188 | 191 | private function toUnderscore($input) |
| 189 | 192 | { |
| 190 | 193 | if (!array_key_exists($input, $this->underscores)) { |
@@ -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 | } |
@@ -19,6 +19,9 @@ |
||
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | + /** |
|
| 23 | + * @param Space $space |
|
| 24 | + */ |
|
| 22 | 25 | private function generateValue($space) |
| 23 | 26 | { |
| 24 | 27 | $spaceId = $space->getId(); |
@@ -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->entities[$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->repositories[$space] = $class; |