public function is($type)
{
if (is_array($type)) {
$result = array_map(array($this, 'is'), $type);
return count(array_filter($result)) > 0;
}
$type = strtolower($type);
if (!isset($this->_detectors[$type])) {
return false;
}
$detect = $this->_detectors[$type];
if (isset($detect['env']) && $this->_environmentDetector($detect)) {
return true;
}
if (isset($detect['header']) && $this->_headerDetector($detect)) {
return true;
}
if (isset($detect['accept']) && $this->_acceptHeaderDetector($detect)) {
return true;
}
if (isset($detect['param']) && $this->_paramDetector($detect)) {
return true;
}
if (isset($detect['callback']) && is_callable($detect['callback'])) {
return call_user_func($detect['callback'], $this);
}
return false;
}