Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 335-342 (lines=8) @@
332
   */
333
  public function termCreate(\stdClass $term) {
334
    // Map vocabulary names to vid, these take precedence over machine names.
335
    if (!isset($term->vid)) {
336
      $vocabularies = \taxonomy_get_vocabularies();
337
      foreach ($vocabularies as $vid => $vocabulary) {
338
        if ($vocabulary->name == $term->vocabulary_machine_name) {
339
          $term->vid = $vocabulary->vid;
340
        }
341
      }
342
    }
343
344
    if (!isset($term->vid)) {
345

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

@@ 355-362 (lines=8) @@
352
   */
353
  public function termCreate(\stdClass $term) {
354
    // Map vocabulary names to vid, these take precedence over machine names.
355
    if (!isset($term->vid)) {
356
      $vocabularies = \taxonomy_get_vocabularies();
357
      foreach ($vocabularies as $vid => $vocabulary) {
358
        if ($vocabulary->name == $term->vocabulary_machine_name) {
359
          $term->vid = $vocabulary->vid;
360
        }
361
      }
362
    }
363
364
    if (!isset($term->vid)) {
365