Code Duplication    Length = 7-7 lines in 2 locations

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

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

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

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