private static function cutString(string $str): string
    {
        static $mb;
        if ($mb === null) {
            $mb = function_exists('mb_strlen');
        }
        if ($mb) {
            $len = mb_strlen($str, 'UTF-8');
        } else {
            $len = strlen($str);
        }
        if ($len > self::MAX_LEN) {
            if ($mb) {
                return mb_substr($str, 0, self::MAX_LEN, 'UTF-8').'...';
            } else {
                return substr($str, 0, self::MAX_LEN).'...';
            }
        }
        return $str;
    }
private static function cutString(string $str): string
    {
        static $mb;
        if ($mb === null) {
            $mb = function_exists('mb_strlen');
        }
        if ($mb) {
            $len = mb_strlen($str, 'UTF-8');
        } else {
            $len = strlen($str);
        }
        if ($len > self::MAX_LEN) {
            if ($mb) {
                return mb_substr($str, 0, self::MAX_LEN, 'UTF-8').'...';
            } else {
                return substr($str, 0, self::MAX_LEN).'...';
            }
        }
        return $str;
    }
private static function cutString ( string $ str ) : string { static $ mb ; if ( $ mb === null ) { $ mb = function_exists ( 'mb_strlen' ) ; } if ( $ mb ) { $ len = mb_strlen ( $ str , 'UTF-8' ) ; } else { $ len = strlen ( $ str ) ; } if ( $ len > self :: MAX_LEN ) { if ( $ mb ) { return mb_substr ( $ str , 0 , self :: MAX_LEN , 'UTF-8' ) . '...' ; } else { return substr ( $ str , 0 , self :: MAX_LEN ) . '...' ; } } return $ str ; }
Cuts a string by the max length

@param string $str
@return string
Cuts a string by the max length