private static function _fetchFloatValue($config, $field, $defaultValue)
{
if (!isset($config[$field])) {
return $defaultValue;
}
$v = $config[$field];
if (is_int($v)) {
return floatval($v);
} else {
return $v;
}
if (is_string($v) && is_numeric($v)) {
return floatval($v);
}
throw new \InvalidArgumentException("{$field} must be float");
}