Code Duplication    Length = 4-4 lines in 2 locations

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

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