StringUnescaper
in package
Table of Contents
Constants
- REPLACEMENTS = ['\\' => '\\', 'n' => "\n", 'r' => "\r", 't' => "\t", 'f' => "\f", 'v' => "\v", 'e' => "\x1b"]
Methods
- 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' => "\n", 'r' => "\r", 't' => "\t", 'f' => "\f", 'v' => "\v", 'e' => "\x1b"]
Methods
unescapeString()
public
static unescapeString(string $string) : string
Parameters
- $string : string
Return values
stringcodePointToUtf8()
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
stringparseEscapeSequences()
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