class Inline (View source)

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

Constants

REGEX_QUOTED_STRING

Properties

static $parsedLineNumber

Methods

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

Converts a YAML string to a PHP value.

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

Dumps a given PHP variable to a YAML string.

static bool
isHash(array|ArrayObject|stdClass $value)

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

static string
parseScalar($scalar, $flags = 0, $delimiters = null, $i = 0, $evaluate = true, $references = array(), $legacyOmittedKeySupport = false)

Parses a YAML scalar.

static string
evaluateBinaryScalar(string $scalar)

No description

Details

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

Converts a YAML string to a PHP value.

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

mixed A PHP value

Exceptions

ParseException

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

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 value

Exceptions

DumpException When trying to dump PHP resource

static bool isHash(array|ArrayObject|stdClass $value)

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

Parameters

array|ArrayObject|stdClass $value The PHP array or array-like object to check

Return Value

bool true if value is hash array, false otherwise

static string parseScalar($scalar, $flags = 0, $delimiters = null, $i = 0, $evaluate = true, $references = array(), $legacyOmittedKeySupport = false)

Parses a YAML scalar.

Parameters

$scalar
$flags
$delimiters
$i
$evaluate
$references
$legacyOmittedKeySupport

Return Value

string

Exceptions

ParseException When malformed inline YAML string is parsed

static string evaluateBinaryScalar(string $scalar)

Parameters

string $scalar

Return Value

string