Code Duplication    Length = 13-13 lines in 3 locations

modules/graphql_core/src/Plugin/GraphQL/Fields/Menu/MenuLinkAttribute.php 1 location

@@ 25-37 (lines=13) @@
22
 *   }
23
 * )
24
 */
25
class MenuLinkAttribute extends FieldPluginBase {
26
27
  /**
28
   * {@inheritdoc}
29
   */
30
  protected function resolveValues($value, array $args, ResolveInfo $info) {
31
    if ($value instanceof MenuLinkTreeElement) {
32
      $options = $value->link->getOptions();
33
      yield NestedArray::getValue($options, ['attributes', $args['key']]);
34
    }
35
  }
36
37
}
38

modules/graphql_core/src/Plugin/GraphQL/Fields/Links/LinkAttribute.php 1 location

@@ 26-38 (lines=13) @@
23
 *   field_types = {"link"}
24
 * )
25
 */
26
class LinkAttribute extends FieldPluginBase {
27
28
  /**
29
   * {@inheritdoc}
30
   */
31
  protected function resolveValues($value, array $args, ResolveInfo $info) {
32
    if ($value instanceof LinkItemInterface) {
33
      $options = $value->getUrl()->getOptions();
34
      yield NestedArray::getValue($options, ['attributes', $args['key']]);
35
    }
36
  }
37
38
}
39

modules/graphql_legacy/graphql_link/src/Plugin/GraphQL/Fields/LinkAttribute.php 1 location

@@ 25-37 (lines=13) @@
22
 *   parents = {"LinkItem"}
23
 * )
24
 */
25
class LinkAttribute extends FieldPluginBase {
26
27
  /**
28
   * {@inheritdoc}
29
   */
30
  protected function resolveValues($value, array $args, ResolveInfo $info) {
31
    if ($value instanceof LinkItemInterface) {
32
      $options = $value->getUrl()->getOptions();
33
      yield NestedArray::getValue($options, ['attributes', $args['key']]);
34
    }
35
  }
36
37
}
38