public static function matches($info, $conditions) {
$checks = static::$_checks;
$handler = static::$_exceptionHandler;
$info = is_object($info) ? $handler($info, true) : $info;
foreach (array_keys($conditions) as $key) {
if ($key == 'conditions' || $key == 'scope' || $key == 'handler') {
continue;
}
if (!isset($info[$key]) || !isset($checks[$key])) {
return false;
}
if (($check = $checks[$key]) && !$check($conditions, $info)) {
return false;
}
}
if ((isset($config['conditions']) && $call = $config['conditions']) && !$call($info)) {
return false;
}
return true;
}