Code Duplication    Length = 12-15 lines in 2 locations

src/Lexer.php 2 locations

@@ 516-530 (lines=15) @@
513
     *
514
     * @return Token
515
     */
516
    public function parseWhitespace()
517
    {
518
        $token = $this->str[$this->last];
519
520
        if (!Context::isWhitespace($token)) {
521
            return null;
522
        }
523
524
        while (++$this->last < $this->len && Context::isWhitespace($this->str[$this->last])) {
525
            $token .= $this->str[$this->last];
526
        }
527
528
        --$this->last;
529
530
        return new Token($token, Token::TYPE_WHITESPACE);
531
    }
532
533
    /**
@@ 903-914 (lines=12) @@
900
     *
901
     * @return Token
902
     */
903
    public function parseUnknown()
904
    {
905
        $token = $this->str[$this->last];
906
        if (Context::isSeparator($token)) {
907
            return null;
908
        }
909
910
        while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) {
911
            $token .= $this->str[$this->last];
912
        }
913
        --$this->last;
914
915
        return new Token($token);
916
    }
917