Text.php
public static function fromCamelCaseToLower($word, string $separator = '-'): string
    {
        $str = '';
        $active = false;
        $word = (string) $word;
        for ($i = 0; $i <= mb_strlen($word); $i++) {
            $char = mb_substr($word, $i, 1, self::ENCODING);
            $str .= ($active && $char >= 'A' && $char <= 'Z' ? $separator : '') . mb_strtolower($char);
            $active = $char !== ' ';
        }
        return $str;
    }
public static function fromCamelCaseToLower($word, string $separator = '-'): string
    {
        $str = '';
        $active = false;
        $word = (string) $word;
        for ($i = 0; $i <= mb_strlen($word); $i++) {
            $char = mb_substr($word, $i, 1, self::ENCODING);
            $str .= ($active && $char >= 'A' && $char <= 'Z' ? $separator : '') . mb_strtolower($char);
            $active = $char !== ' ';
        }
        return $str;
    }
public static function fromCamelCaseToLower ( $ word , string $ separator = '-' ) : string { $ str = '' ; $ active = false ; $ word = ( string ) $ word ; for ( $ i = 0 ; $ i <= mb_strlen ( $ word ) ; $ i ++ ) { $ char = mb_substr ( $ word , $ i , 1 , self :: ENCODING ) ; $ str .= ( $ active && $ char >= 'A' && $ char <= 'Z' ? $ separator : '' ) . mb_strtolower ( $ char ) ; $ active = $ char !== ' ' ; } return $ str ; }
CamelCase -> camel-case
@param string $word
@param string $separator
@return string
CamelCase - > camel - case