Code Duplication    Length = 9-13 lines in 2 locations

src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php 1 location

@@ 23-31 (lines=9) @@
20
  /**
21
   * {@inheritdoc}
22
   */
23
  public static function createInstance(SchemaBuilder $builder, TypePluginManager $manager, $definition, $id) {
24
    return new InputObjectType([
25
      'name' => $definition['name'],
26
      'description' => $definition['description'],
27
      'fields' => function () use ($builder, $definition) {
28
        return $builder->processArguments($definition['fields']);
29
      },
30
    ]);
31
  }
32
33
  /**
34
   * {@inheritdoc}

src/Plugin/GraphQL/Interfaces/InterfacePluginBase.php 1 location

@@ 20-32 (lines=13) @@
17
  /**
18
   * {@inheritdoc}
19
   */
20
  public static function createInstance(SchemaBuilder $builder, TypePluginManager $manager, $definition, $id) {
21
    return new InterfaceType([
22
      'name' => $definition['name'],
23
      'description' => $definition['description'],
24
      'fields' => function () use ($builder, $definition) {
25
        return $builder->getFields($definition['name']);
26
      },
27
      // TODO: Implement this.
28
//      'resolveType' => function () use ($builder, $definition) {
29
//        return $builder->getPossibleTypes($definition['name']);
30
//      },
31
    ]);
32
  }
33
34
  /**
35
   * {@inheritdoc}