Completed
Branch feature/pre-split (a19743)
by Anton
03:44
created
source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         if (empty($matched = $this->matchOne($record))) {
173 173
             throw new RelationException(
174
-                "Unable to get pivotData for non linked record" . ($this->autoload ? '' : " (partial on)")
174
+                "Unable to get pivotData for non linked record".($this->autoload ? '' : " (partial on)")
175 175
             );
176 176
         }
177 177
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
             }
362 362
 
363 363
             //Syncing pivot data values
364
-            $command->onComplete(function (ContextualCommandInterface $command) use ($record) {
364
+            $command->onComplete(function(ContextualCommandInterface $command) use ($record) {
365 365
                 //Now when we are done we can sync our values with current data
366 366
                 $this->pivotData->offsetSet($record, $command->getContext());
367 367
             });
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
         ContextualCommandInterface $outerCommand
502 502
     ) {
503 503
         //Parent record dependency
504
-        $parentCommand->onExecute(function ($parentCommand) use ($pivotCommand, $parent) {
504
+        $parentCommand->onExecute(function($parentCommand) use ($pivotCommand, $parent) {
505 505
             $pivotCommand->addContext(
506 506
                 $this->key(Record::THOUGHT_INNER_KEY),
507 507
                 $this->lookupKey(Record::INNER_KEY, $parent, $parentCommand)
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
         });
510 510
 
511 511
         //Outer record dependency
512
-        $outerCommand->onExecute(function ($outerCommand) use ($pivotCommand, $outer) {
512
+        $outerCommand->onExecute(function($outerCommand) use ($pivotCommand, $outer) {
513 513
             $pivotCommand->addContext(
514 514
                 $this->key(Record::THOUGHT_OUTER_KEY),
515 515
                 $this->lookupKey(Record::OUTER_KEY, $outer, $outerCommand)
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
             $loader,
556 556
             [
557 557
                 'alias'      => $table->getName(),
558
-                'pivotAlias' => $table->getName() . '_pivot',
558
+                'pivotAlias' => $table->getName().'_pivot',
559 559
                 'method'     => RelationLoader::POSTLOAD
560 560
             ]
561 561
         );
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
         $query = $loader->configureQuery($query, [$innerKey]);
566 566
 
567 567
         //Additional pivot conditions
568
-        $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName() . '_pivot');
568
+        $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName().'_pivot');
569 569
         $pivotDecorator->where($this->schema[Record::WHERE_PIVOT]);
570 570
 
571 571
         //Additional where conditions!
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
     {
615 615
         if ($diff = array_diff(array_keys($pivotData), $this->schema[Record::PIVOT_COLUMNS])) {
616 616
             throw new RelationException(
617
-                "Invalid pivot data, undefined columns found: " . join(', ', $diff)
617
+                "Invalid pivot data, undefined columns found: ".join(', ', $diff)
618 618
             );
619 619
         }
620 620
     }
Please login to merge, or discard this patch.