Completed
Push — master ( b4b95a...6bab26 )
by Dmitry
01:47
created
src/Plugin/Temporal.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -31,6 +31,9 @@  discard block
 block discarded – undo
31 31
         return $this->getData($entity, $id, $date, '_temporal_override_aggregate');
32 32
     }
33 33
 
34
+    /**
35
+     * @param string $space
36
+     */
34 37
     private function getData($entity, $id, $date, $space)
35 38
     {
36 39
         $entity = $this->entityNameToId($entity);
@@ -250,6 +253,9 @@  discard block
 block discarded – undo
250 253
         return $data;
251 254
     }
252 255
 
256
+    /**
257
+     * @param string $type
258
+     */
253 259
     private function updateAggregation($type, $params, $changeaxis)
254 260
     {
255 261
         $isLink = $type === 'link';
@@ -358,6 +364,9 @@  discard block
 block discarded – undo
358 364
         return $this->mapper->findOne('_temporal_entity', compact('id'))->name;
359 365
     }
360 366
 
367
+    /**
368
+     * @param string $name
369
+     */
361 370
     private function initSchema($name)
362 371
     {
363 372
         switch ($name) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
         while (!$clean) {
317 317
             $clean = true;
318 318
             foreach ($states as $i => $state) {
319
-                if (array_key_exists($i+1, $states)) {
320
-                    $next = $states[$i+1];
319
+                if (array_key_exists($i + 1, $states)) {
320
+                    $next = $states[$i + 1];
321 321
                     if (!count(array_diff_assoc($state['data'], $next['data']))) {
322 322
                         $states[$i]['end'] = $next['end'];
323
-                        unset($states[$i+1]);
323
+                        unset($states[$i + 1]);
324 324
                         $states = array_values($states);
325 325
                         $clean = false;
326 326
                         break;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             $this->mapper->addPlugin(Sequence::class);
341 341
         }
342 342
 
343
-        $this->mapper->getSchema()->once(__CLASS__.'@entity', function (Mapper $mapper) {
343
+        $this->mapper->getSchema()->once(__CLASS__.'@entity', function(Mapper $mapper) {
344 344
             $this->mapper->getSchema()
345 345
                 ->createSpace('_temporal_entity', [
346 346
                     'id'   => 'unsigned',
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
     {
363 363
         switch ($name) {
364 364
             case 'override':
365
-                return $this->mapper->getSchema()->once(__CLASS__.'@states', function (Mapper $mapper) {
365
+                return $this->mapper->getSchema()->once(__CLASS__.'@states', function(Mapper $mapper) {
366 366
                     $mapper->getSchema()
367 367
                         ->createSpace('_temporal_override', [
368 368
                             'entity'     => 'unsigned',
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                 });
388 388
 
389 389
             case 'link':
390
-                return $this->mapper->getSchema()->once(__CLASS__.'@link', function (Mapper $mapper) {
390
+                return $this->mapper->getSchema()->once(__CLASS__.'@link', function(Mapper $mapper) {
391 391
                     $mapper->getSchema()
392 392
                         ->createSpace('_temporal_link', [
393 393
                             'id'        => 'unsigned',
Please login to merge, or discard this patch.