Comos\Qpm\Supervision\Config::_fetchFloatValue PHP Method

_fetchFloatValue() private static method

private static _fetchFloatValue ( $config, $field, $defaultValue )
    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");
    }