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

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