Flow\TokenStream::next PHP Method

next() public method

public next ( $queue = true )
    public function next($queue = true)
    {
        if ($this->eos) {
            return $this->currentToken;
        }
        $token = $this->tokens[$this->cursor++];
        $old = $this->currentToken;
        $this->currentToken = $token;
        $this->eos = $token->getType() === Token::EOF;
        return $old;
    }