Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. OutputFormatter.php

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\Formatter

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal