class sfYamlInline (View source)

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

Constants

REGEX_QUOTED_STRING

Methods

static array
load(string $value)

Convert a YAML string to a PHP array.

static string
dump(mixed $value)

Dumps a given PHP variable to a YAML string.

static string
dumpArray(array $value)

Dumps a PHP array to a YAML string.

static string
parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), $i = 0, $evaluate = true)

Parses a scalar to a YAML string.

static string
parseQuotedScalar(string $scalar, integer $i)

Parses a quoted scalar to YAML.

static string
parseSequence(string $sequence, integer $i = 0)

Parses a sequence to a YAML string.

static string
parseMapping(string $mapping, integer $i = 0)

Parses a mapping to a YAML string.

static string
evaluateScalar(string $scalar)

Evaluates scalars and replaces magic values.

static 
getTimestampRegex()

No description

Details

static array load(string $value)

Convert a YAML string to a PHP array.

Parameters

string $value A YAML string

Return Value

array A PHP array representing the YAML string

static string dump(mixed $value)

Dumps a given PHP variable to a YAML string.

Parameters

mixed $value The PHP variable to convert

Return Value

string The YAML string representing the PHP array

static protected string dumpArray(array $value)

Dumps a PHP array to a YAML string.

Parameters

array $value The PHP array to dump

Return Value

string The YAML string representing the PHP array

static string parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), $i = 0, $evaluate = true)

Parses a scalar to a YAML string.

Parameters

$scalar
$delimiters
$stringDelimiters
$i
$evaluate

Return Value

string A YAML string

static protected string parseQuotedScalar(string $scalar, integer $i)

Parses a quoted scalar to YAML.

Parameters

string $scalar
integer $i

Return Value

string A YAML string

static protected string parseSequence(string $sequence, integer $i = 0)

Parses a sequence to a YAML string.

Parameters

string $sequence
integer $i

Return Value

string A YAML string

static protected string parseMapping(string $mapping, integer $i = 0)

Parses a mapping to a YAML string.

Parameters

string $mapping
integer $i

Return Value

string A YAML string

static protected string evaluateScalar(string $scalar)

Evaluates scalars and replaces magic values.

Parameters

string $scalar

Return Value

string A YAML string

static protected getTimestampRegex()