40 return str_replace(
'\'\
'',
'\'', $value);
52 $callback =
function ($match) {
57 return preg_replace_callback(
'/'.self::REGEX_ESCAPED_CHARACTER.
'/u', $callback, $value);
106 return "\xE2\x80\xA8";
109 return "\xE2\x80\xA9";
111 return self::utf8chr(hexdec(substr($value, 2, 2)));
113 return self::utf8chr(hexdec(substr($value, 2, 4)));
115 return self::utf8chr(hexdec(substr($value, 2, 8)));
117 throw new ParseException(sprintf(
'Found unknown escape character "%s".', $value));
130 if (0x80 >
$c %= 0x200000) {
134 return chr(0xC0 |
$c >> 6).chr(0x80 |
$c & 0x3F);
137 return chr(0xE0 |
$c >> 12).chr(0x80 |
$c >> 6 & 0x3F).chr(0x80 |
$c & 0x3F);
140 return chr(0xF0 |
$c >> 18).chr(0x80 |
$c >> 12 & 0x3F).chr(0x80 |
$c >> 6 & 0x3F).chr(0x80 |
$c & 0x3F);
static utf8chr($c)
Get the UTF-8 character for the given code point.
const REGEX_ESCAPED_CHARACTER
Regex fragment that matches an escaped character in a double quoted string.
Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.
unescapeSingleQuotedString($value)
Unescapes a single quoted string.
Exception class thrown when an error occurs during parsing.
unescapeCharacter($value)
Unescapes a character that was found in a double-quoted string.
unescapeDoubleQuotedString($value)
Unescapes a double quoted string.