public static function to_snake($string)
    {
        if (\ctype_lower($string)) {
            return $string;
        }

        $string = \preg_replace('/\s+/u', '', \ucwords($string));

        $string = \trim(\preg_replace('/([^_])(?=[A-Z])/', '$1_', $string), '_');

        return \strtolower($string);
    }