StringUnescaper
in package
Table of Contents
- REPLACEMENTS = ['\' => '\', 'n' => " ", 'r' => " ", 't' => " ", 'f' => "", 'v' => "", 'e' => ""]
- unescapeString() : string
- codePointToUtf8() : string
- Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154
- parseEscapeSequences() : string
- Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130
Constants
REPLACEMENTS
private
mixed
REPLACEMENTS
= ['\' => '\', 'n' => "
", 'r' => "
", 't' => " ", 'f' => "", 'v' => "", 'e' => ""]
Methods
unescapeString()
public
static unescapeString(string $string) : string
Parameters
- $string : string
Return values
string —codePointToUtf8()
Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154
private
static codePointToUtf8(int $num) : string
Parameters
- $num : int
Return values
string —parseEscapeSequences()
Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130
private
static parseEscapeSequences(string $str, string $quote) : string
Parameters
- $str : string
- $quote : string