You are here

public static function OutputFormatter::escape in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Formatter/OutputFormatter.php \Symfony\Component\Console\Formatter\OutputFormatter::escape()

Escapes "<" special char in given text.

Parameters

string $text Text to escape:

Return value

string Escaped text

3 calls to OutputFormatter::escape()
FormatterHelper::formatBlock in vendor/symfony/console/Helper/FormatterHelper.php
Formats a message as a block of text.
OutputFormatterTest::testLGCharEscaping in vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
SymfonyStyle::block in vendor/symfony/console/Style/SymfonyStyle.php
Formats a message as a block of text.

File

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

Class

OutputFormatter
Formatter class for console output.

Namespace

Symfony\Component\Console\Formatter

Code

public static function escape($text) {
  return preg_replace('/([^\\\\]?)</', '$1\\<', $text);
}