PhpStringTokenParser

class PhpStringTokenParser

Methods

static string parse(string $str)

Parses a string token.

static string parseEscapeSequences(string $str, null|string $quote)

Parses escape sequences in strings (all string types apart from single quoted).

static string parseDocString(string $startToken, string $str)

Parses a constant doc string.

Details

static string parse(string $str)

Parses a string token.

Parameters

string $str String token content

Return Value

string The parsed string

static string parseEscapeSequences(string $str, null|string $quote)

Parses escape sequences in strings (all string types apart from single quoted).

Parameters

string $str String without quotes
null|string $quote Quote type

Return Value

string String with escape sequences parsed

static string parseDocString(string $startToken, string $str)

Parses a constant doc string.

Parameters

string $startToken Doc string start token content (<<<SMTHG)
string $str String token content

Return Value

string Parsed string

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Translation/Extractor/PhpStringTokenParser.html