Code Duplication    Length = 14-16 lines in 2 locations

src/Lexer.php 2 locations

@@ 540-555 (lines=16) @@
537
     *
538
     * @return Token
539
     */
540
    public function parseWhitespace()
541
    {
542
        $token = $this->str[$this->last];
543
544
        if (!Context::isWhitespace($token)) {
545
            return null;
546
        }
547
548
        while (++$this->last < $this->len && Context::isWhitespace($this->str[$this->last])) {
549
            $token .= $this->str[$this->last];
550
        }
551
552
        --$this->last;
553
554
        return new Token($token, Token::TYPE_WHITESPACE);
555
    }
556
557
    /**
558
     * Parses a comment.
@@ 926-939 (lines=14) @@
923
     *
924
     * @return Token
925
     */
926
    public function parseUnknown()
927
    {
928
        $token = $this->str[$this->last];
929
        if (Context::isSeparator($token)) {
930
            return null;
931
        }
932
933
        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
934
            $token .= $this->str[$this->last];
935
        }
936
        --$this->last;
937
938
        return new Token($token);
939
    }
940
941
    /**
942
     * Parses the delimiter of the query.