public function nextIf($primary, $secondary = null)
    {
        if ($this->tokens[$this->current]->test($primary, $secondary)) {
            return $this->next();
        }
    }
public function nextIf($primary, $secondary = null)
    {
        if ($this->tokens[$this->current]->test($primary, $secondary)) {
            return $this->next();
        }
    }
public function nextIf ( $ primary , $ secondary = null ) { if ( $ this -> tokens [ $ this -> current ] -> test ( $ primary , $ secondary ) ) { return $ this -> next ( ) ; } }
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.

@return Twig_Token|null The next token if the condition is true, null otherwise
Tests a token sets the pointer to the next one and returns it or throws a syntax error .