Code Duplication    Length = 6-6 lines in 2 locations

src/Drupal/Driver/Cores/Drupal7.php 2 locations

@@ 110-115 (lines=6) @@
107
108
    // Attempt to decipher any fields that may be specified.
109
    $this->expandEntityFields('node', $values);
110
    foreach ($values as $k => $v) {
111
      if (!property_exists($node, $k)) {
112
        throw new \Exception(sprintf("%s::%s line %s: Attempt to modify an invalid field: %s", get_class($this), __LINE__, __FUNCTION__, $k));
113
      }
114
      $node->{$k} = $v;
115
    }
116
    node_save($node);
117
  }
118
@@ 175-180 (lines=6) @@
172
    $user = user_load($user->uid, TRUE);
173
    // Attempt to decipher any fields that may be specified in values.
174
    $this->expandEntityFields('user', $values);
175
    foreach ($values as $k => $v) {
176
      if (!property_exists($user, $k)) {
177
        throw new \Exception(sprintf("%s::%s line %s: Attempt to modify an invalid field: %s", get_class($this), __LINE__, __FUNCTION__, $k));
178
      }
179
      $user->{$k} = $v;
180
    }
181
    user_save($user);
182
  }
183