Code Duplication    Length = 10-10 lines in 2 locations

src/Driver/Cores/Drupal8.php 2 locations

@@ 58-67 (lines=10) @@
55
  /**
56
   * {@inheritdoc}
57
   */
58
  public function loadNodeByName($title) {
59
    $result = \Drupal::entityQuery('node')
60
      ->condition('title', $title)
61
      ->condition('status', NODE_PUBLISHED)
62
      ->range(0, 1)
63
      ->execute();
64
    assert($result, isNotEmpty());
65
    $nid = current($result);
66
    return Node::load($nid);
67
  }
68
69
  /**
70
   * {@inheritdoc}
@@ 117-126 (lines=10) @@
114
  /**
115
   * {@inheritdoc}
116
   */
117
  public function loadTaxonomyTermByName($type, $name) {
118
    $result = \Drupal::entityQuery('taxonomy_term')
119
      ->condition('name', $name)
120
      ->condition('vid', $type)
121
      ->range(0, 1)
122
      ->execute();
123
    assert($result, isNotEmpty());
124
    $id = current($result);
125
    return Term::load($id);
126
  }
127
128
  /**
129
   * {@inheritdoc}