class drush_outputformat_yaml

  1. 8.0.x commands/core/outputformat/yaml.inc drush_outputformat_yaml
  2. 6.x commands/core/outputformat/yaml.inc drush_outputformat_yaml
  3. 7.x commands/core/outputformat/yaml.inc drush_outputformat_yaml
  4. master commands/core/outputformat/yaml.inc drush_outputformat_yaml

Output formatter 'yaml'

Hierarchy

Expanded class hierarchy of drush_outputformat_yaml

Members

File

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

View source
class drush_outputformat_yaml extends drush_outputformat {
  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;
  }
}