function OutputFormatter::escapeTrailingBackslash
Escapes trailing "\" in given text.
@internal
6 calls to OutputFormatter::escapeTrailingBackslash()
- OutputFormatter::escape in vendor/
symfony/ console/ Formatter/ OutputFormatter.php - Escapes "<" and ">" special chars in given text.
- QuestionHelper::autocomplete in vendor/
symfony/ console/ Helper/ QuestionHelper.php - Autocompletes a question.
- SymfonyQuestionHelper::writePrompt in vendor/
symfony/ console/ Helper/ SymfonyQuestionHelper.php - Outputs the question prompt.
- SymfonyStyle::section in vendor/
symfony/ console/ Style/ SymfonyStyle.php - Formats a section title.
- SymfonyStyle::title in vendor/
symfony/ console/ Style/ SymfonyStyle.php - Formats a command title.
File
-
vendor/
symfony/ console/ Formatter/ OutputFormatter.php, line 52
Class
- OutputFormatter
- Formatter class for console output.
Namespace
Symfony\Component\Console\FormatterCode
public static function escapeTrailingBackslash(string $text) : string {
if (str_ends_with($text, '\\')) {
$len = \strlen($text);
$text = rtrim($text, '\\');
$text = str_replace("\x00", '', $text);
$text .= str_repeat("\x00", $len - \strlen($text));
}
return $text;
}