Passed
Pull Request — master (#37)
by
unknown
15:02 queued 16s
created
src/Traits/RelationshipMongoTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
             $is_embeds_has_to_be_updated = $request->has($key);
62 62
 
63
-            if (! is_null($value) && ! ($value == '') && ! ($value == '[]')) {
63
+            if (!is_null($value) && !($value == '') && !($value == '[]')) {
64 64
                 $objs = json_decode($value);
65 65
             } else {
66 66
                 $objs = getArrayWithEmptyObj($model, $is_EO, $is_EM);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     }
81 81
                 }
82 82
 
83
-                if (! empty($objs)) {
83
+                if (!empty($objs)) {
84 84
                     if ($is_EM) {
85 85
                         $this->tempEM = [];
86 86
                     }
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function updateRelationWithSync($mini_model, string $method_on_target, $is_EO_target, $is_EM_target)
129 129
     {
130
-        if(is_null($this->$method_on_target)){
131
-            throw new Exception('Method on target for ' . $method_on_target . ' doesn\'t exist');
130
+        if (is_null($this->$method_on_target)) {
131
+            throw new Exception('Method on target for '.$method_on_target.' doesn\'t exist');
132 132
         } else {
133 133
             if ($is_EM_target) {
134 134
                 $new_values = [];
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     {
189 189
         if ($is_EO) {
190 190
             $embedObj = $this->$method;
191
-            if (! is_null($embedObj)) {
191
+            if (!is_null($embedObj)) {
192 192
                 $target_id = $embedObj->ref_id;
193 193
                 $this->handleSubTarget($target_id, $modelTarget, $methodOnTarget, $is_EO_target, $is_EM_target);
194 194
             }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         if ($is_EM_target) {
212 212
             $target = new $modelTarget;
213 213
             $target = $target->all()->where('id', $target_id)->first();
214
-            if (! is_null($target)) {
214
+            if (!is_null($target)) {
215 215
                 $new_values = [];
216 216
                 foreach ($target->$methodOnTarget as $temp) {
217 217
                     if ($temp->ref_id !== $this->getId()) {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $EOitems = $embedObj->getItems();
246 246
         //Current Obj Create
247 247
         foreach ($EOitems as $EOkey => $item) {
248
-            if (! is_null($obj)) {
248
+            if (!is_null($obj)) {
249 249
                 $is_ML = isML($item);
250 250
                 $is_MD = isMD($item);
251 251
                 $this->checkPropertyExistence($obj, $EOkey, $method, $model);
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     private function processEmbedOnTargetCollection($modelTarget, $obj, $methodOnTarget, $modelOnTarget, $is_EO_target, $is_EM_target)
295 295
     {
296 296
         $modelToBeSync = $this->getModelTobeSync($modelTarget, $obj);
297
-        if (! is_null($modelToBeSync)) {
297
+        if (!is_null($modelToBeSync)) {
298 298
             $miniModel = $this->getEmbedModel($modelOnTarget);
299 299
             $modelToBeSync->updateRelationWithSync($miniModel, $methodOnTarget, $is_EO_target, $is_EM_target);
300 300
             //TODO:Sync target on level > 1
Please login to merge, or discard this patch.