Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 98-101 (lines=4) @@
95
   *   An object with field/value parameters.
96
   */
97
  public function nodeAlter($node, $values) {
98
    if (empty($node) || !isset($node->nid)) {
99
      var_dump(array_keys(get_object_vars($node)));
100
      throw new \Exception(sprintf("%s::%s: Node was empty or had no id", get_class($this), __FUNCTION__));
101
    }
102
    // Assign type (really, bundle) to values so that expansion functions will
103
    // work properly.
104
    $values->type = $node->type;
@@ 167-170 (lines=4) @@
164
   *   An object with field/value parameters.
165
   */
166
  public function userAlter($user, $values) {
167
    if (empty($user) || !isset($user->uid)) {
168
      var_dump(array_keys(get_object_vars($user)));
169
      throw new \Exception(sprintf("%s::%s: User was empty or had no id", get_class($this), __FUNCTION__));
170
    }
171
    // Reload user from the db so we ensure we're dealing with an unmodified
172
    // version of the user.  Reset flag is critical here.
173
    $user = user_load($user->uid, TRUE);