Code Duplication    Length = 7-7 lines in 2 locations

src/Drupal/Driver/Cores/Drupal6.php 1 location

@@ 352-358 (lines=7) @@
349
    }
350
351
    // If `parent` is set, look up a term in this vocab with that name.
352
    if (isset($term->parent)) {
353
      $parent = \taxonomy_get_term_by_name($term->parent);
354
      if (!empty($parent)) {
355
        $parent = reset($parent);
356
        $term->parent = $parent->tid;
357
      }
358
    }
359
360
    if (empty($term->vid)) {
361
      throw new \Exception(sprintf('No "%s" vocabulary found.'));

src/Drupal/Driver/Cores/Drupal7.php 1 location

@@ 307-313 (lines=7) @@
304
    }
305
306
    // If `parent` is set, look up a term in this vocab with that name.
307
    if (isset($term->parent)) {
308
      $parent = \taxonomy_get_term_by_name($term->parent, $term->vocabulary_machine_name);
309
      if (!empty($parent)) {
310
        $parent = reset($parent);
311
        $term->parent = $parent->tid;
312
      }
313
    }
314
315
    if (empty($term->vid)) {
316
      throw new \Exception(sprintf('No "%s" vocabulary found.'));