PhpCss\Parser::matchToken PHP Method

matchToken() protected method

Returns true if the token at the given position exists and the provided token type matches type of the token at this position, false otherwise.
protected matchToken ( integer $position, integer $type ) : boolean
$position integer
$type integer
return boolean
    protected function matchToken($position, $type)
    {
        if (!isset($this->_tokens[$position])) {
            return false;
        }
        if ($type === Scanner\Token::ANY) {
            // A token has been found. We do not care which one it was
            return true;
        }
        return $this->_tokens[$position]->type === $type;
    }