Tests the current token for a type and/or a value.
Parameters may be:
array|integer $type The type to test:
array|string|null $values The token value:
Boolean
public function test($type, $values = null) {
if (null === $values && !is_int($type)) {
$values = $type;
$type = self::NAME_TYPE;
}
return $this->type === $type && (null === $values || is_array($values) && in_array($this->value, $values) || $this->value == $values);
}