function OutputFormatter::addLineBreaks
1 call to OutputFormatter::addLineBreaks()
- OutputFormatter::applyCurrentStyle in vendor/
symfony/ console/ Formatter/ OutputFormatter.php - Applies current style from stack to text, if must be applied.
File
-
vendor/
symfony/ console/ Formatter/ OutputFormatter.php, line 261
Class
- OutputFormatter
- Formatter class for console output.
Namespace
Symfony\Component\Console\FormatterCode
private function addLineBreaks(string $text, int $width) : string {
$encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8';
return b($text)->toCodePointString($encoding)
->wordwrap($width, "\n", true)
->toByteString($encoding);
}