Code Duplication    Length = 20-20 lines in 2 locations

src/Query/Parser.php 2 locations

@@ 85-104 (lines=20) @@
82
        return new ValueObject($fields, $location);
83
    }
84
85
    private function parseList()
86
    {
87
        $location = $this->expect(Token::T_BRACKET_LEFT)->location;
88
        $items = array();
89
90
        while (true) {
91
            if ($this->scanner->eof()) {
92
                throw $this->getParseError('Unclosed bracket of list');
93
            }
94
95
            if ($this->accept(Token::T_BRACKET_RIGHT)) {
96
                break;
97
            }
98
99
            $items[] = $this->parseValue();
100
            $this->accept(Token::T_COMMA);
101
        }
102
103
        return new ValueList($items, $location);
104
    }
105
106
    private function parseVariable()
107
    {
@@ 262-281 (lines=20) @@
259
        throw $this->getParseError($message . " but instead found \"{$token->getName()}\" with value \"{$token->value}\"");
260
    }
261
262
    private function parseSelectionSet()
263
    {
264
        $location = $this->expect(Token::T_BRACE_LEFT)->location;
265
266
        /** @var Selection[] $selections */
267
        $selections = array();
268
        while (true) {
269
            if ($this->scanner->eof()) {
270
                throw $this->getParseError('Unclosed brace of selection set');
271
            }
272
273
            if ($this->accept(Token::T_BRACE_RIGHT)) {
274
                break;
275
            }
276
277
            $selections[] = $this->parseSelection();
278
        }
279
280
        return new SelectionSet($selections, $location);
281
    }
282
283
    private function parseTypeCondition()
284
    {