public static function string($value, $max_length = null)
    {
        /*if (!is_string($value)) {
            throw new \Exception('not_a_string');
        }*/
        $value = filter_var(trim($value), FILTER_SANITIZE_STRING);

        if ($max_length && mb_strlen($value) > $max_length) {
            $value = mb_substr($value, 0, $max_length);
        }
        return $value;
    }