Class

Symfony\Component\Yaml\Escaper

class Escaper

Escaper encapsulates escaping rules for single and double-quoted YAML strings.

Constants

REGEX_CHARACTER_TO_ESCAPE

Methods

static bool requiresDoubleQuoting(string $value)

Determines if a PHP value would require double quoting in YAML.

static string escapeWithDoubleQuotes(string $value)

Escapes and surrounds a PHP value with double quotes.

static bool requiresSingleQuoting(string $value)

Determines if a PHP value would require single quoting in YAML.

static string escapeWithSingleQuotes(string $value)

Escapes and surrounds a PHP value with single quotes.

Details

at line 49
static public bool requiresDoubleQuoting(string $value)

Determines if a PHP value would require double quoting in YAML.

Parameters

string $value A PHP value

Return Value

bool True if the value would require double quotes.

at line 61
static public string escapeWithDoubleQuotes(string $value)

Escapes and surrounds a PHP value with double quotes.

Parameters

string $value A PHP value

Return Value

string The quoted, escaped string

at line 73
static public bool requiresSingleQuoting(string $value)

Determines if a PHP value would require single quoting in YAML.

Parameters

string $value A PHP value

Return Value

bool True if the value would require single quotes.

at line 85
static public string escapeWithSingleQuotes(string $value)

Escapes and surrounds a PHP value with single quotes.

Parameters

string $value A PHP value

Return Value

string The quoted, escaped string