Code Duplication    Length = 12-15 lines in 2 locations

src/Lexer.php 2 locations

@@ 540-554 (lines=15) @@
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
    /**
@@ 927-938 (lines=12) @@
924
     *
925
     * @return Token
926
     */
927
    public function parseUnknown()
928
    {
929
        $token = $this->str[$this->last];
930
        if (Context::isSeparator($token)) {
931
            return null;
932
        }
933
934
        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
935
            $token .= $this->str[$this->last];
936
        }
937
        --$this->last;
938
939
        return new Token($token);
940
    }
941