function Unescaper::unescapeCharacter
Unescapes a character that was found in a double-quoted string.
Parameters
string $value An escaped character:
1 call to Unescaper::unescapeCharacter()
- Unescaper::unescapeDoubleQuotedString in vendor/
symfony/ yaml/ Unescaper.php - Unescapes a double quoted string.
File
-
vendor/
symfony/ yaml/ Unescaper.php, line 59
Class
- Unescaper
- Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.
Namespace
Symfony\Component\YamlCode
private function unescapeCharacter(string $value) : string {
return match ($value[1]) { '0' => "\x00",
'a' => "\x07",
'b' => "\x08",
't' => "\t",
"\t" => "\t",
'n' => "\n",
'v' => "\v",
'f' => "\f",
'r' => "\r",
'e' => "\x1b",
' ' => ' ',
'"' => '"',
'/' => '/',
'\\' => '\\',
'N' => "
",
'_' => " ",
'L' => "
",
'P' => "
",
'x' => self::utf8chr(hexdec(substr($value, 2, 2))),
'u' => self::utf8chr(hexdec(substr($value, 2, 4))),
'U' => self::utf8chr(hexdec(substr($value, 2, 8))),
default => throw new ParseException(\sprintf('Found unknown escape character "%s".', $value)),
};
}