public static function breakLongText(
        $text,
        $perLine = 100,
        $separator = '<br>',
        $encoding = 'utf-8',
        $proportionalAberration = 20
    ) {
        $effect = $text;
        $textLength = mb_strlen($text);

        if (!empty($text) && $textLength > $perLine) {
            /*
             * The html_entity_decode() function is used here, because while operating
             * on string that contains only special characters the string is divided
             * incorrectly, e.g. "<<<<<" -> "&lt;&lt;&lt;&lt;&<br />lt;".
             */
            //$text = htmlspecialchars_decode($text);
            $text = html_entity_decode($text, ENT_QUOTES);

            $effect = '';
            $currentPosition = 0;

            $charsAberration = ceil($perLine * ($proportionalAberration / 100));
            $charsPerLineDefault = $perLine;

            while ($currentPosition <= $textLength) {
                $insertSeparator = false;

                /*
                 * Looking for spaces before and after current position. It was done, because text wasn't
                 * broken properly and some words were breaked and placed into two lines.
                 */
                if ($charsAberration > 0) {
                    $length = $perLine + $charsAberration;
                    $lineWithAberration = mb_substr($text, $currentPosition, $length, $encoding);

                    if (!Regex::contains($lineWithAberration, ' ')) {
                        $length = $perLine - $charsAberration;
                        $lineWithAberration = mb_substr($text, $currentPosition, $length, $encoding);
                    }

                    if (Regex::startsWith($lineWithAberration, ' ')) {
                        ++$currentPosition;
                        $lineWithAberration = ltrim($lineWithAberration);
                    }

                    $spacePosition = mb_strrpos($lineWithAberration, ' ', 0, $encoding);

                    if (false !== $spacePosition && 0 < $spacePosition) {
                        /** @var int $spacePosition */
                        $perLine = $spacePosition;
                        $insertSeparator = true;
                    }
                }

                $charsOneLine = mb_substr($text, $currentPosition, $perLine, $encoding);

                /*
                 * The htmlspecialchars() function is used here, because...
                 * Reason and comment the same as above for html_entity_decode() function.
                 */

                $effect .= htmlspecialchars($charsOneLine);
                //$effect .= $charsOneLine;

                $currentPosition += $perLine;
                $oneLineContainsSpace = Regex::contains($charsOneLine, ' ');

                if (($insertSeparator || !$oneLineContainsSpace) && $currentPosition <= $textLength) {
                    $effect .= $separator;
                }

                $perLine = $charsPerLineDefault;
            }
        }

        return $effect;
    }