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
File
-
vendor/
symfony/ console/ Helper/ Helper.php, line 145
Class
- Helper
- Helper is the base class for all helper classes.
Namespace
Symfony\Component\Console\HelperCode
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;
}