public static function substringToWord($text, $maxLength, $suffix = '...')
    {
        $effect = $text;

        $textLength = mb_strlen($text, 'utf-8');
        $suffixLength = mb_strlen($suffix, 'utf-8');

        $maxLength -= $suffixLength;

        if ($textLength > $maxLength) {
            $effect = mb_substr($text, 0, $maxLength, 'utf-8');
            $lastSpacePosition = mb_strrpos($effect, ' ', 'utf-8');

            if (false !== $lastSpacePosition) {
                $effect = mb_substr($effect, 0, $lastSpacePosition, 'utf-8');
            }

            $effect .= $suffix;
        }

        return $effect;
    }