public static function Helper::strlenWithoutDecoration in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Helper/Helper.php \Symfony\Component\Console\Helper\Helper::strlenWithoutDecoration()
5 calls to Helper::strlenWithoutDecoration()
- 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::block in vendor/
symfony/ console/ Style/ SymfonyStyle.php - Formats a message as a block of text.
- Table::getCellWidth in vendor/
symfony/ console/ Helper/ Table.php - Gets cell width.
- Table::renderCell in vendor/
symfony/ console/ Helper/ Table.php - Renders table cell with padding.
File
- vendor/
symfony/ console/ Helper/ Helper.php, line 109
Class
- Helper
- Helper is the base class for all helper classes.
Namespace
Symfony\Component\Console\HelperCode
public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string) {
$isDecorated = $formatter
->isDecorated();
$formatter
->setDecorated(false);
// remove <...> formatting
$string = $formatter
->format($string);
// remove already formatted characters
$string = preg_replace("/\33\\[[^m]*m/", '', $string);
$formatter
->setDecorated($isDecorated);
return self::strlen($string);
}