Test Failed
Pull Request — master (#54)
by
unknown
07:00
created
src/SaveRelationsBehavior.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         if (!($value instanceof $relation->modelClass)) {
168 168
             //we have an existing hasone relation model
169
-            if(is_array($value) && $this->_getRelatedFks($value, $relation, $relation->modelClass) && $owner->{$relationName} instanceof $relation->modelClass && !$owner->{$relationName}->getIsNewRecord()) {
169
+            if (is_array($value) && $this->_getRelatedFks($value, $relation, $relation->modelClass) && $owner->{$relationName} instanceof $relation->modelClass && !$owner->{$relationName}->getIsNewRecord()) {
170 170
                 $this->_loadRelationModel($value, $relationName, $owner->{$relationName});
171 171
                 $value = $owner->{$relationName};
172 172
             } else {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         );
579 579
 
580 580
         // Deleted relations
581
-        $initialModels = ArrayHelper::index($this->_oldRelationValue[$relationName], function (BaseActiveRecord $model) {
581
+        $initialModels = ArrayHelper::index($this->_oldRelationValue[$relationName], function(BaseActiveRecord $model) {
582 582
             return implode('-', $model->getPrimaryKey(true));
583 583
         });
584 584
         $initialRelations = $owner->{$relationName};
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
         // Added relations
590 590
         $actualModels = ArrayHelper::index(
591 591
             $junctionTablePropertiesUsed ? $initialRelations : $owner->{$relationName},
592
-            function (BaseActiveRecord $model) {
592
+            function(BaseActiveRecord $model) {
593 593
                 return implode('-', $model->getPrimaryKey(true));
594 594
             }
595 595
         );
@@ -636,10 +636,10 @@  discard block
 block discarded – undo
636 636
     private function _computePkDiff($initialRelations, $updatedRelations, $forceSave = false)
637 637
     {
638 638
         // Compute differences between initial relations and the current ones
639
-        $oldPks = ArrayHelper::getColumn($initialRelations, function (BaseActiveRecord $model) {
639
+        $oldPks = ArrayHelper::getColumn($initialRelations, function(BaseActiveRecord $model) {
640 640
             return implode('-', $model->getPrimaryKey(true));
641 641
         });
642
-        $newPks = ArrayHelper::getColumn($updatedRelations, function (BaseActiveRecord $model) {
642
+        $newPks = ArrayHelper::getColumn($updatedRelations, function(BaseActiveRecord $model) {
643 643
             return implode('-', $model->getPrimaryKey(true));
644 644
         });
645 645
         if ($forceSave) {
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
      */
840 840
     private function _loadRelationModel($data, $relationName, ?Model $relationModel): void
841 841
     {
842
-        if($relationModel === null) {
842
+        if ($relationModel === null) {
843 843
             return;
844 844
         }
845 845
 
Please login to merge, or discard this patch.
src/SaveRelationsTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
                 $relationName = $key;
36 36
             }
37 37
 
38
-            if(!isset($data[$scope][$relationName])) {
38
+            if (!isset($data[$scope][$relationName])) {
39 39
                 continue;
40 40
             }
41 41
 
42 42
             $relation = $this->getRelation($relationName);
43 43
 
44
-            if(!$relation) {
44
+            if (!$relation) {
45 45
                 continue;
46 46
             }
47 47
 
Please login to merge, or discard this patch.