function drush_outputformat_yaml::format

8.0.x yaml.inc drush_outputformat_yaml::format($input, $metadata)
6.x yaml.inc drush_outputformat_yaml::format($input, $metadata)
7.x yaml.inc drush_outputformat_yaml::format($input, $metadata)
master yaml.inc drush_outputformat_yaml::format($input, $metadata)

Overrides drush_outputformat::format

File

commands/core/outputformat/yaml.inc, line 16

Class

drush_outputformat_yaml
Output formatter 'yaml'

Code

function format($input, $metadata) {
  $dumper = new Dumper();
  // Set Yaml\Dumper's default indentation for nested nodes/collections to
  // 2 spaces for consistency with Drupal coding standards.
  $dumper->setIndentation(2);
  // The level where you switch to inline YAML is set to PHP_INT_MAX to
  // ensure this does not occur.
  $output = $dumper->dump($input, PHP_INT_MAX, NULL, NULL, TRUE);
  return $output;
}