Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 88-91 (lines=4) @@
85
   *          error will be in the exception.
86
   */
87
  public function nodeAlter($node, $values) {
88
    if (empty($node) || !isset($node->nid)) {
89
      var_dump(array_keys(get_object_vars($node)));
90
      throw new \Exception(sprintf("%s::%s: Node was empty or had no id", get_class($this), __FUNCTION__));
91
    }
92
    // Assign type (really, bundle) to values so that expansion functions will
93
    // work properly.
94
    $values->type = $node->type;
@@ 152-155 (lines=4) @@
149
   *          error will be in the exception.
150
   */
151
  public function userAlter($user, $values) {
152
    if (empty($user) || !isset($user->uid)) {
153
      var_dump(array_keys(get_object_vars($user)));
154
      throw new \Exception(sprintf("%s::%s: User was empty or had no id", get_class($this), __FUNCTION__));
155
    }
156
    // Attempt to decipher any fields that may be specified.
157
    $this->expandEntityFields('user', $values);
158
    foreach ($values as $k => $v) {