Browse Source

Reduce nesting.

Mark Story 8 years ago
parent
commit
c3d2dcf1dd
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/ORM/Marshaller.php

+ 6 - 5
src/ORM/Marshaller.php

@@ -595,11 +595,12 @@ class Marshaller
         }
 
         foreach ((array)$options['fields'] as $field) {
-            if (array_key_exists($field, $properties)) {
-                $entity->set($field, $properties[$field]);
-                if ($properties[$field] instanceof EntityInterface) {
-                    $entity->setDirty($field, $properties[$field]->isDirty());
-                }
+            if (!array_key_exists($field, $properties)) {
+                continue;
+            }
+            $entity->set($field, $properties[$field]);
+            if ($properties[$field] instanceof EntityInterface) {
+                $entity->setDirty($field, $properties[$field]->isDirty());
             }
         }