32 "\x00",
"\x01",
"\x02",
"\x03",
"\x04",
"\x05",
"\x06",
"\x07",
33 "\x08",
"\x09",
"\x0a",
"\x0b",
"\x0c",
"\x0d",
"\x0e",
"\x0f",
34 "\x10",
"\x11",
"\x12",
"\x13",
"\x14",
"\x15",
"\x16",
"\x17",
35 "\x18",
"\x19",
"\x1a",
"\x1b",
"\x1c",
"\x1d",
"\x1e",
"\x1f",
36 "\xc2\x85",
"\xc2\xa0",
"\xe2\x80\xa8",
"\xe2\x80\xa9");
38 '\\0',
'\\x01',
'\\x02',
'\\x03',
'\\x04',
'\\x05',
'\\x06',
'\\a',
39 '\\b',
'\\t',
'\\n',
'\\v',
'\\f',
'\\r',
'\\x0e',
'\\x0f',
40 '\\x10',
'\\x11',
'\\x12',
'\\x13',
'\\x14',
'\\x15',
'\\x16',
'\\x17',
41 '\\x18',
'\\x19',
'\\x1a',
'\\e',
'\\x1c',
'\\x1d',
'\\x1e',
'\\x1f',
42 '\\N',
'\\_',
'\\L',
'\\P');
53 return preg_match(
'/'.self::REGEX_CHARACTER_TO_ESCAPE.
'/u', $value);
65 return sprintf(
'"%s"', str_replace(self::$escapees, self::$escaped, $value));
79 if (in_array(strtolower($value),
array(
'null',
'~',
'true',
'false',
'y',
'n',
'yes',
'no',
'on',
'off'))) {
85 return preg_match(
'/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
97 return sprintf(
"'%s'", str_replace(
'\'',
'\'\
'', $value));
static requiresDoubleQuoting($value)
Determines if a PHP value would require double quoting in YAML.
Escaper encapsulates escaping rules for single and double-quoted YAML strings.
Create styles array
The data for the language used.
static escapeWithDoubleQuotes($value)
Escapes and surrounds a PHP value with double quotes.
static escapeWithSingleQuotes($value)
Escapes and surrounds a PHP value with single quotes.
const REGEX_CHARACTER_TO_ESCAPE
static requiresSingleQuoting($value)
Determines if a PHP value would require single quoting in YAML.