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

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