Inline

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

author

Fabien Potencier

Methods

Converts a YAML string to a PHP array.

parse(string $value) : array
static

Arguments

$value

string

A YAML string

Response

array

A PHP array representing the YAML string

Dumps a given PHP variable to a YAML string.

dump(mixed $value) : string
static
throws

When trying to dump PHP resource

Arguments

$value

mixed

The PHP variable to convert

Response

string

The YAML string representing the PHP array

Dumps a PHP array to a YAML string.

dumpArray(array $value) : string
static

Arguments

$value

array

The PHP array to dump

Response

string

The YAML string representing the PHP array

Parses a scalar to a YAML string.

parseScalar(scalar $scalar, string $delimiters = null, array $stringDelimiters = array('"', "'"), &$i, Boolean $evaluate = true) : string
static
throws

When malformed inline YAML string is parsed

Arguments

$scalar

scalar

$delimiters

string

$stringDelimiters

array

$i

$evaluate

Boolean

Response

string

A YAML string

Parses a quoted scalar to YAML.

parseQuotedScalar(string $scalar, &$i) : string
static
throws

When malformed inline YAML string is parsed

Arguments

$scalar

string

$i

Response

string

A YAML string

Parses a sequence to a YAML string.

parseSequence(string $sequence, &$i) : string
static
throws

When malformed inline YAML string is parsed

Arguments

$sequence

string

$i

Response

string

A YAML string

Parses a mapping to a YAML string.

parseMapping(string $mapping, &$i) : string
static
throws

When malformed inline YAML string is parsed

Arguments

$mapping

string

$i

Response

string

A YAML string

Evaluates scalars and replaces magic values.

evaluateScalar(string $scalar) : string
static

Arguments

$scalar

string

Response

string

A YAML string

Gets a regex that matches an unix timestamp

getTimestampRegex() : string
static

Response

string

The regular expression

Constants

REGEX_QUOTED_STRING

REGEX_QUOTED_STRING