Code Duplication    Length = 16-18 lines in 2 locations

src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionParser.php 2 locations

@@ 411-426 (lines=16) @@
408
     *
409
     * @return AbstractExpression
410
     */
411
    private function parseParenExpression()
412
    {
413
        if ($this->getCurrentToken()->Id != ExpressionTokenId::OPENPARAM) {
414
            throw ODataException::createSyntaxError('Open parenthesis expected.');
415
        }
416
417
        $this->lexer->nextToken();
418
        $expr = $this->parseExpression();
419
        if ($this->getCurrentToken()->Id != ExpressionTokenId::CLOSEPARAM) {
420
            throw ODataException::createSyntaxError('Close parenthesis expected.');
421
        }
422
423
        $this->lexer->nextToken();
424
425
        return $expr;
426
    }
427
428
    /**
429
     * Parse an identifier.
@@ 520-537 (lines=18) @@
517
     *
518
     * @return array<AbstractExpression>
519
     */
520
    private function parseArgumentList()
521
    {
522
        if ($this->getCurrentToken()->Id != ExpressionTokenId::OPENPARAM) {
523
            throw ODataException::createSyntaxError('Open parenthesis expected.');
524
        }
525
526
        $this->lexer->nextToken();
527
        $args = $this->getCurrentToken()->Id != ExpressionTokenId::CLOSEPARAM
528
             ? $this->parseArguments() : [];
529
        if ($this->getCurrentToken()->Id != ExpressionTokenId::CLOSEPARAM) {
530
            throw ODataException::createSyntaxError('Close parenthesis expected.');
531
        }
532
533
        $this->lexer->nextToken();
534
535
        return $args;
536
    }
537
538
    /**
539
     * Parse arguments of  a function-call.
540
     *