class YmlFormat extends YamlFormat (View source)

YAML format proxy.

Methods

static string
structToString(object $struct, array $options = array())

Converts an object into a YAML formatted string.

static object
stringToStruct(string $data, array $options = array())

Parse a YAML formatted string and convert it into an object.

static Parser
getParser()

getParser

static YamlFormat
setParser(Parser $parser)

setParser

static Dumper
getDumper()

getDumper

static YamlFormat
setDumper(Dumper $dumper)

setDumper

Details

in YamlFormat at line line 47
static string structToString(object $struct, array $options = array())

Converts an object into a YAML formatted string.

We use json_* to convert the passed object to an array.

Parameters

object $struct Data Source Object.
array $options An array of options for the formatter.

Return Value

string Formatted string.

in YamlFormat at line line 66
static object stringToStruct(string $data, array $options = array())

Parse a YAML formatted string and convert it into an object.

We use the json_* methods to convert the parsed YAML array to an object.

Parameters

string $data Formatted string
array $options An array of options for the formatter.

Return Value

object Data Object

in YamlFormat at line line 76
static Parser getParser()

getParser

Return Value

Parser

in YamlFormat at line line 93
static YamlFormat setParser(Parser $parser)

setParser

Parameters

Parser $parser

Return Value

YamlFormat Return self to support chaining.

in YamlFormat at line line 103
static Dumper getDumper()

getDumper

Return Value

Dumper

in YamlFormat at line line 120
static YamlFormat setDumper(Dumper $dumper)

setDumper

Parameters

Dumper $dumper

Return Value

YamlFormat Return self to support chaining.