Code Duplication    Length = 15-16 lines in 2 locations

src/Introspection/FieldType.php 1 location

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

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