HTMLPurifier_Injector::forward PHP Method

forward() protected method

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.
protected forward ( integer &$i, HTMLPurifier_Token &$current ) : boolean
$i integer Current integer index variable for inputTokens
$current HTMLPurifier_Token Current token variable. Do NOT use $token, as that variable is also a reference
return boolean
    protected function forward(&$i, &$current)
    {
        if ($i === null) {
            $i = count($this->inputZipper->back) - 1;
        } else {
            $i--;
        }
        if ($i < 0) {
            return false;
        }
        $current = $this->inputZipper->back[$i];
        return true;
    }