Completed
Branch feature/pre-split (c70fe0)
by Anton
03:38
created
source/Spiral/ORM/Entities/Relations/HasManyRelation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
         if (!$this->isSynced($this->parent, $instance)) {
176 176
             //Delayed linking
177
-            $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) {
177
+            $parentCommand->onExecute(function($outerCommand) use ($innerCommand) {
178 178
                 $innerCommand->addContext(
179 179
                     $this->key(Record::OUTER_KEY),
180 180
                     $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand)
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             //Morph key
233 233
             $decorator = new WhereDecorator($selector, 'where', $selector->getAlias());
234 234
             $decorator->where(
235
-                '{@}.' . $this->key(Record::MORPH_KEY),
235
+                '{@}.'.$this->key(Record::MORPH_KEY),
236 236
                 $this->orm->define(get_class($this->parent), ORMInterface::R_ROLE_NAME)
237 237
             );
238 238
         }
Please login to merge, or discard this patch.
source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             }
285 285
 
286 286
             //Syncing pivot data values
287
-            $command->onComplete(function (ContextualCommandInterface $command) use ($record) {
287
+            $command->onComplete(function(ContextualCommandInterface $command) use ($record) {
288 288
                 //Now when we are done we can sync our values with current data
289 289
                 $this->pivotData->offsetSet(
290 290
                     $record,
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         ContextualCommandInterface $outerCommand
332 332
     ) {
333 333
         //Parent record dependency
334
-        $parentCommand->onExecute(function ($parentCommand) use ($pivotCommand, $parent) {
334
+        $parentCommand->onExecute(function($parentCommand) use ($pivotCommand, $parent) {
335 335
             $pivotCommand->addContext(
336 336
                 $this->key(Record::THOUGHT_INNER_KEY),
337 337
                 $this->lookupKey(Record::INNER_KEY, $parent, $parentCommand)
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         });
340 340
 
341 341
         //Outer record dependency
342
-        $outerCommand->onExecute(function ($outerCommand) use ($pivotCommand, $outer) {
342
+        $outerCommand->onExecute(function($outerCommand) use ($pivotCommand, $outer) {
343 343
             $pivotCommand->addContext(
344 344
                 $this->key(Record::THOUGHT_OUTER_KEY),
345 345
                 $this->lookupKey(Record::OUTER_KEY, $outer, $outerCommand)
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             $loader,
414 414
             [
415 415
                 'alias'      => $table->getName(),
416
-                'pivotAlias' => $table->getName() . '_pivot',
416
+                'pivotAlias' => $table->getName().'_pivot',
417 417
                 'method'     => RelationLoader::POSTLOAD
418 418
             ]
419 419
         );
@@ -423,12 +423,12 @@  discard block
 block discarded – undo
423 423
         $query = $loader->configureQuery($query, [$innerKey]);
424 424
 
425 425
         //Additional pivot conditions
426
-        $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName() . '_pivot');
426
+        $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName().'_pivot');
427 427
         $pivotDecorator->where($this->schema[Record::WHERE_PIVOT]);
428 428
 
429 429
         if (!empty($this->key(Record::MORPH_KEY))) {
430 430
             $pivotDecorator->where(
431
-                '{@}.' . $this->key(Record::MORPH_KEY),
431
+                '{@}.'.$this->key(Record::MORPH_KEY),
432 432
                 //todo: overwrite
433 433
                 $this->orm->define(get_class($this->parent), ORMInterface::R_ROLE_NAME)
434 434
             );
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
     {
499 499
         if ($diff = array_diff(array_keys($pivotData), $this->schema[Record::PIVOT_COLUMNS])) {
500 500
             throw new RelationException(
501
-                "Invalid pivot data, undefined columns found: " . join(', ', $diff)
501
+                "Invalid pivot data, undefined columns found: ".join(', ', $diff)
502 502
             );
503 503
         }
504 504
     }
Please login to merge, or discard this patch.
source/Spiral/ORM/Entities/Relations/HasOneRelation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         //Inversed version of BelongsTo
90 90
         if (!$this->isSynced($this->parent, $this->instance)) {
91 91
             //Syncing FKs after primary command been executed
92
-            $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) {
92
+            $parentCommand->onExecute(function($outerCommand) use ($innerCommand) {
93 93
                 $innerCommand->addContext(
94 94
                     $this->key(Record::OUTER_KEY),
95 95
                     $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand)
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         if (!empty($morphKey = $this->key(Record::MORPH_KEY))) {
121 121
             //HasOne relation support additional morph key
122
-            $where['{@}.' . $this->key(Record::MORPH_KEY)] = $this->orm->define(
122
+            $where['{@}.'.$this->key(Record::MORPH_KEY)] = $this->orm->define(
123 123
                 get_class($this->parent),
124 124
                 ORMInterface::R_ROLE_NAME
125 125
             );
Please login to merge, or discard this patch.