Code Duplication    Length = 15-16 lines in 2 locations

src/Introspection/InputValueType.php 1 location

@@ 41-55 (lines=15) @@
38
        return $resolvedValue === null ? $resolvedValue : json_encode($resolvedValue);
39
    }
40
41
    public function build($config)
42
    {
43
        $config
44
            ->addField('name', new NonNullType(TypeMap::TYPE_STRING))
45
            ->addField('description', TypeMap::TYPE_STRING)
46
            ->addField(new Field([
47
                'name'    => 'type',
48
                'type'    => new NonNullType(new QueryType()),
49
                'resolve' => [$this, 'resolveType']
50
            ]))
51
            ->addField('defaultValue', [
52
                'type' => TypeMap::TYPE_STRING,
53
                'resolve' => [$this, 'resolveDefaultValue']
54
            ]);
55
    }
56
57
    /**
58
     * @return string type name

src/Introspection/FieldType.php 1 location

@@ 33-48 (lines=16) @@
30
        return [];
31
    }
32
33
    public function build($config)
34
    {
35
        $config
36
            ->addField('name', TypeMap::TYPE_STRING)
37
            ->addField('description', TypeMap::TYPE_STRING)
38
            ->addField('isDeprecated', TypeMap::TYPE_BOOLEAN)
39
            ->addField('deprecationReason', TypeMap::TYPE_STRING)
40
            ->addField('type', [
41
                'type'    => new QueryType(),
42
                'resolve' => [$this, 'resolveType'],
43
            ])
44
            ->addField('args', [
45
                'type'    => new ListType(new InputValueType()),
46
                'resolve' => [$this, 'resolveArgs'],
47
            ]);
48
    }
49
50
    public function isValidValue($value)
51
    {