    public static function validateNumber(
        $path,
        $values,
        $allow_neg,
        $allow_zero,
        $max_value,
        $error_string
    ) {
        if ($values[$path] === '') {
            return '';
        }

        if (intval($values[$path]) != $values[$path]
            || (! $allow_neg && $values[$path] < 0)
            || (! $allow_zero && $values[$path] == 0)
            || $values[$path] > $max_value
        ) {
            return $error_string;
        }

        return '';
    }