public function tokens() : array
    {
        $tokens = [];

        while ($token = $this->next()) 
        {
            // skip doublicated linebreaks
            if (
                $token->getType() === T::TOKEN_LINE && 
                isset($tokens[count($tokens) - 1]) && 
                $tokens[count($tokens) - 1]->getType() === T::TOKEN_LINE
            ) {
                continue;
            }

            $tokens[] = $token;
        }

        return $tokens;
    }
public function tokens() : array
    {
        $tokens = [];

        while ($token = $this->next()) 
        {
            // skip doublicated linebreaks
            if (
                $token->getType() === T::TOKEN_LINE && 
                isset($tokens[count($tokens) - 1]) && 
                $tokens[count($tokens) - 1]->getType() === T::TOKEN_LINE
            ) {
                continue;
            }

            $tokens[] = $token;
        }

        return $tokens;
    }
public function tokens ( ) : array { $ tokens = [ ] ; while ( $ token = $ this -> next ( ) ) { // skip doublicated linebreaks if ( $ token -> getType ( ) === T :: TOKEN_LINE && isset ( $ tokens [ count ( $ tokens ) - 1 ] ) && $ tokens [ count ( $ tokens ) - 1 ] -> getType ( ) === T :: TOKEN_LINE ) { continue ; } $ tokens [ ] = $ token ; } return $ tokens ; }
Start the lexer and retrieve all resulting tokens.

@return array[Token]
Start the lexer and retrieve all resulting tokens .