private static function _fetchIntValue($config, $field, $defaultValue)
{
if (!isset($config[$field])) {
return $defaultValue;
}
$v = $config[$field];
if (is_float($v)) {
return intval($v);
} else {
return $v;
}
if (is_string($v)) {
if (is_numeric($v)) {
return intval($v);
}
}
throw new \InvalidArgumentException("{$field} must be int");
}