Completed
Push — master ( f6db52...9cdeb8 )
by Dmitry
14:08
created
src/Client.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Schema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
src/Space.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -200,6 +200,9 @@
 block discarded – undo
200 200
         return $this;
201 201
     }
202 202
 
203
+    /**
204
+     * @param string $name
205
+     */
203 206
     public function getReference($name)
204 207
     {
205 208
         return $this->isReference($name) ? $this->formatReferences[$name] : null;
Please login to merge, or discard this patch.
src/Mapper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -29,6 +29,9 @@  discard block
 block discarded – undo
29 29
         return $plugin;
30 30
     }
31 31
 
32
+    /**
33
+     * @param string $space
34
+     */
32 35
     public function create($space, $data)
33 36
     {
34 37
         return $this->getRepository($space)->create($data)->save();
@@ -39,6 +42,11 @@  discard block
 block discarded – undo
39 42
         return $this->getRepository($space)->findOne($params);
40 43
     }
41 44
 
45
+    /**
46
+     * @param string $space
47
+     *
48
+     * @return Entity
49
+     */
42 50
     public function findOrCreate($space, $params = [])
43 51
     {
44 52
         return $this->getRepository($space)->findOrCreate($params)->save();
@@ -49,6 +57,9 @@  discard block
 block discarded – undo
49 57
         return $this->getRepository($space)->findOrFail($params)->save();
50 58
     }
51 59
 
60
+    /**
61
+     * @param string $space
62
+     */
52 63
     public function find($space, $params = [])
53 64
     {
54 65
         return $this->getRepository($space)->find($params);
Please login to merge, or discard this patch.
src/Bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Plugin/Annotation.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -185,6 +185,9 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                         $space->addIndex($index);
140 140
                     } catch (Exception $e) {
141 141
                         $presentation = json_encode($properties['indexes'][$i]);
142
-                        throw new Exception("Failed to add index $presentation. ". $e->getMessage(), 0, $e);
142
+                        throw new Exception("Failed to add index $presentation. ".$e->getMessage(), 0, $e);
143 143
                     }
144 144
                 }
145 145
             }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         foreach ($schema->getSpaces() as $space) {
149 149
             if (!count($space->getIndexes())) {
150 150
                 if (!$space->hasProperty('id')) {
151
-                    throw new Exception("No primary index on ". $space->getName());
151
+                    throw new Exception("No primary index on ".$space->getName());
152 152
                 }
153 153
                 $space->addIndex(['id']);
154 154
             }
Please login to merge, or discard this patch.
src/Plugin/UserClasses.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Repository.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -270,6 +270,9 @@
 block discarded – undo
270 270
         $this->results = [];
271 271
     }
272 272
 
273
+    /**
274
+     * @param Entity $instance
275
+     */
273 276
     public function save($instance)
274 277
     {
275 278
         $key = $this->space->getInstanceKey($instance);
Please login to merge, or discard this patch.
src/Plugin/NestedSet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,12 +51,12 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.