3 use Symfony\Component\Yaml\Dumper;
6 * Output formatter 'yaml'
9 * The $data parameter is rendered in yaml
15 class drush_outputformat_yaml extends drush_outputformat {
16 function format($input, $metadata) {
17 $dumper = new Dumper();
18 // Set Yaml\Dumper's default indentation for nested nodes/collections to
19 // 2 spaces for consistency with Drupal coding standards.
20 $dumper->setIndentation(2);
21 // The level where you switch to inline YAML is set to PHP_INT_MAX to
22 // ensure this does not occur.
23 $output = $dumper->dump($input, PHP_INT_MAX, NULL, NULL, TRUE);