protected function maybeWrapText($text) { if (!isset($this->m_bodyWordWrappingIsDisabled) || !$this->m_bodyWordWrappingIsDisabled) { // Wrap the text. $width; if (!isset($this->m_bodyWordWrappingWidth)) { $width = self::$ms_defaultWordWrappingWidth; } else { $width = $this->m_bodyWordWrappingWidth; } $text = CUString::wordWrap($text, $width); } return $text; }
/** * Wraps the text in a string to a specified width and returns the new string. * * @param int $width The wrapping width, in characters. * @param bitfield $wrappingFlags **OPTIONAL. Default is** `WRAPPING_DEFAULT`. The wrapping option(s). The * available options are `WRAPPING_BREAK_SPACELESS_LINES`, `WRAPPING_ALLOW_TRAILING_SPACES`, * `WRAPPING_DISALLOW_LEADING_SPACES`, and `WRAPPING_DONT_BREAK_SPACELESS_CJK_ENDING_LINES` * (see [Summary](#summary)). * @param string $newline **OPTIONAL. Default is** LF (U+000A). The newline character(s) to be used for making * new lines in the process of wrapping. * * @return CUStringObject The wrapped text. */ public function wordWrap($width, $wrappingFlags = self::WRAPPING_DEFAULT, $newline = self::NEWLINE) { return CUString::wordWrap($this, $width, $wrappingFlags, $newline); }