class Yaml

Yaml helper class

Methods

mixed
parse(string $contents)

Parses supplied YAML contents in to a PHP array.

array
parseFile(string $fileName)

Parses YAML file contents in to a PHP array.

string
render(array $vars = [], array $options = [])

Renders a PHP array to YAML format.

Details

at line 22
mixed parse(string $contents)

Parses supplied YAML contents in to a PHP array.

Parameters

string $contents

YAML contents to parse

Return Value

mixed

the YAML contents as an array

at line 34
array parseFile(string $fileName)

Parses YAML file contents in to a PHP array.

Parameters

string $fileName

file to read contents and parse

Return Value

array

the YAML contents as an array

at line 52
string render(array $vars = [], array $options = [])

Renders a PHP array to YAML format.

Parameters

array $vars vars
array $options

options

Supported options:

  • inline: The level where you switch to inline YAML.
  • exceptionOnInvalidType: if an exception must be thrown on invalid types.
  • objectSupport: if object support is enabled.

Return Value

string