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

Breadcrumb

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

function Helper::removeDecoration

13 calls to Helper::removeDecoration()
ConsoleSectionOutput::getDisplayLength in vendor/symfony/console/Output/ConsoleSectionOutput.php
ProgressBar::buildLine in vendor/symfony/console/Helper/ProgressBar.php
ProgressBar::initPlaceholderFormatters in vendor/symfony/console/Helper/ProgressBar.php
ProgressBar::overwrite in vendor/symfony/console/Helper/ProgressBar.php
Overwrites a previous message to the output.
SymfonyStyle::createBlock in vendor/symfony/console/Style/SymfonyStyle.php

... See full list

File

vendor/symfony/console/Helper/Helper.php, line 145

Class

Helper
Helper is the base class for all helper classes.

Namespace

Symfony\Component\Console\Helper

Code

public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) : string {
    $isDecorated = $formatter->isDecorated();
    $formatter->setDecorated(false);
    // remove <...> formatting
    $string = $formatter->format($string ?? '');
    // remove already formatted characters
    $string = preg_replace("/\x1b\\[[^m]*m/", '', $string ?? '');
    // remove terminal hyperlinks
    $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? '');
    $formatter->setDecorated($isDecorated);
    return $string;
}

API Navigation

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