Latte\TokenIterator::expectNextValue PHP Method

expectNextValue() public method

Returns next expected token or throws exception.
public expectNextValue ( ) : string
return string
    public function expectNextValue()
    {
        if ($token = $this->scan(func_get_args(), TRUE, TRUE)) {
            // onlyFirst, advance
            return $token[Tokenizer::VALUE];
        }
        $pos = $this->position + 1;
        while (isset($this->tokens[$pos]) && ($next = $this->tokens[$pos]) && in_array($next[Tokenizer::TYPE], $this->ignored, TRUE)) {
            $pos++;
        }
        throw new CompileException("Unexpected token '" . $next[Tokenizer::VALUE] . "'.");
    }