Inline

class Inline

Inline implements a YAML parser/dumper for the YAML inline syntax.

Constants

REGEX_QUOTED_STRING

Methods

static array parse(string $value, int $flags, array $references = array())

Converts a YAML string to a PHP array.

static string dump(mixed $value, int $flags)

Dumps a given PHP variable to a YAML string.

static bool isHash(array $value)

Check if given array is hash or just normal indexed array.

static string parseScalar(string $scalar, int $flags, string $delimiters = null, array $stringDelimiters = array('"', '\''), int $i, bool $evaluate = true, array $references = array())

Parses a scalar to a YAML string.

static string evaluateBinaryScalar(string $scalar)

Details

static array parse(string $value, int $flags, array $references = array())

Converts a YAML string to a PHP array.

Parameters

string $value A YAML string
int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
array $references Mapping of variable names to values

Return Value

array A PHP array representing the YAML string

Exceptions

ParseException

static string dump(mixed $value, int $flags)

Dumps a given PHP variable to a YAML string.

Parameters

mixed $value The PHP variable to convert
int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string

Return Value

string The YAML string representing the PHP array

Exceptions

DumpException When trying to dump PHP resource

static bool isHash(array $value)

Check if given array is hash or just normal indexed array.

Parameters

array $value The PHP array to check

Return Value

bool true if value is hash array, false otherwise

static string parseScalar(string $scalar, int $flags, string $delimiters = null, array $stringDelimiters = array('"', '\''), int $i, bool $evaluate = true, array $references = array())

Parses a scalar to a YAML string.

Parameters

string $scalar
int $flags
string $delimiters
array $stringDelimiters
int $i &$i
bool $evaluate
array $references

Return Value

string A YAML string

Exceptions

ParseException When malformed inline YAML string is parsed

static string evaluateBinaryScalar(string $scalar)

Parameters

string $scalar

Return Value

string
doc_Symfony
2016-10-28 06:21:03
Comments
Leave a Comment

Please login to continue.