Code Duplication    Length = 13-19 lines in 2 locations

src/Query/Parser.php 1 location

@@ 313-325 (lines=13) @@
310
        return $directives;
311
    }
312
313
    private function parseVariableDefinition()
314
    {
315
        $variable = $this->parseVariable();
316
        $this->expect(Token::T_COLON);
317
        $type = $this->parseType();
318
        $defaultValue = null;
319
320
        if ($this->accept(Token::T_EQUAL)) {
321
            $defaultValue = $this->parseValue();
322
        }
323
324
        return new VariableDefinition($variable, $type, $defaultValue, $variable->location);
325
    }
326
327
    private function parseVariableDefinitionList()
328
    {

src/Schema/Parser.php 1 location

@@ 189-207 (lines=19) @@
186
        return $arguments;
187
    }
188
189
    private function parseField($forInputObject)
190
    {
191
        $nameToken = $this->expect(Token::T_NAME);
192
193
        $arguments = array();
194
        if ($forInputObject === false) {
195
            $arguments = $this->parseFieldArguments();
196
        }
197
198
        $this->expect(Token::T_COLON);
199
        $type = $this->parseType();
200
201
        return new Field(
202
            $nameToken->value,
203
            $type,
204
            $arguments,
205
            $nameToken->location
206
        );
207
    }
208
209
    private function parseObjectDeclaration()
210
    {