Code Duplication    Length = 12-15 lines in 2 locations

src/Lexer.php 2 locations

@@ 539-553 (lines=15) @@
536
     *
537
     * @return Token
538
     */
539
    public function parseWhitespace()
540
    {
541
        $token = $this->str[$this->last];
542
543
        if (!Context::isWhitespace($token)) {
544
            return null;
545
        }
546
547
        while ((++$this->last < $this->len) && (Context::isWhitespace($this->str[$this->last]))) {
548
            $token .= $this->str[$this->last];
549
        }
550
551
        --$this->last;
552
        return new Token($token, Token::TYPE_WHITESPACE);
553
    }
554
555
    /**
556
     * Parses a comment.
@@ 898-909 (lines=12) @@
895
     *
896
     * @return Token
897
     */
898
    public function parseUnknown()
899
    {
900
        $token = $this->str[$this->last];
901
        if (Context::isSeparator($token)) {
902
            return null;
903
        }
904
        while ((++$this->last < $this->len) && (!Context::isSeparator($this->str[$this->last]))) {
905
            $token .= $this->str[$this->last];
906
        }
907
        --$this->last;
908
        return new Token($token);
909
    }
910
911
    /**
912
     * Parses the delimiter of the query.