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

Breadcrumb

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

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.

... See full list

File

vendor/symfony/console/Formatter/OutputFormatter.php, line 52

Class

OutputFormatter
Formatter class for console output.

Namespace

Symfony\Component\Console\Formatter

Code

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

API Navigation

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