Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 366-372 (lines=7) @@
363
    }
364
365
    // If `parent` is set, look up a term in this vocab with that name.
366
    if (isset($term->parent)) {
367
      $parent = \taxonomy_get_term_by_name($term->parent, $term->vocabulary_machine_name);
368
      if (!empty($parent)) {
369
        $parent = reset($parent);
370
        $term->parent = $parent->tid;
371
      }
372
    }
373
374
    if (empty($term->vid)) {
375
      throw new \Exception(sprintf('No "%s" vocabulary found.'));

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

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