Symfony2 API
Class

Symfony\Component\Yaml\Dumper

class Dumper

Dumper dumps PHP variables to YAML strings.

Methods

setIndentation(int $num)

Sets the indentation.

string dump(mixed $input, int $inline, int $indent, bool $exceptionOnInvalidType = false, bool $objectSupport = false)

Dumps a PHP value to YAML.

Details

at line 33
public setIndentation(int $num)

Sets the indentation.

Parameters

int $num The amount of spaces to use for indentation of nested nodes.

at line 49
public string dump(mixed $input, int $inline, int $indent, bool $exceptionOnInvalidType = false, bool $objectSupport = false)

Dumps a PHP value to YAML.

Parameters

mixed $input The PHP value
int $inline The level where you switch to inline YAML
int $indent The level of indentation (used internally)
bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
bool $objectSupport true if object support is enabled, false otherwise

Return Value

string The YAML representation of the PHP value