You are here

public static function Yaml::dump in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/yaml/Yaml.php \Symfony\Component\Yaml\Yaml::dump()

Dumps a PHP array to a YAML string.

The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.

Parameters

array $array PHP array:

int $inline The level where you switch to inline YAML:

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

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 A YAML string representing the original PHP array

2 calls to Yaml::dump()
YamlFileDumper::format in vendor/symfony/translation/Dumper/YamlFileDumper.php
Transforms a domain of a message catalogue to its string representation.
YamlTest::testParseAndDump in vendor/symfony/yaml/Tests/YamlTest.php

File

vendor/symfony/yaml/Yaml.php, line 92

Class

Yaml
Yaml offers convenience methods to load and dump YAML.

Namespace

Symfony\Component\Yaml

Code

public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) {
  $yaml = new Dumper();
  $yaml
    ->setIndentation($indent);
  return $yaml
    ->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport);
}