Code Duplication    Length = 14-16 lines in 2 locations

src/Lexer.php 2 locations

@@ 900-913 (lines=14) @@
897
     *
898
     * @return null|Token
899
     */
900
    public function parseUnknown()
901
    {
902
        $token = $this->str[$this->last];
903
        if (Context::isSeparator($token)) {
904
            return null;
905
        }
906
907
        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
908
            $token .= $this->str[$this->last];
909
        }
910
        --$this->last;
911
912
        return new Token($token);
913
    }
914
915
    /**
916
     * Parses the delimiter of the query.
@@ 506-521 (lines=16) @@
503
     *
504
     * @return null|Token
505
     */
506
    public function parseWhitespace()
507
    {
508
        $token = $this->str[$this->last];
509
510
        if (!Context::isWhitespace($token)) {
511
            return null;
512
        }
513
514
        while (++$this->last < $this->len && Context::isWhitespace($this->str[$this->last])) {
515
            $token .= $this->str[$this->last];
516
        }
517
518
        --$this->last;
519
520
        return new Token($token, Token::TYPE_WHITESPACE);
521
    }
522
523
    /**
524
     * Parses a comment.