Yaffs site version 1.1
[yaffs-website] / vendor / drush / drush / commands / core / outputformat / yaml.inc
1 <?php
2
3 use Symfony\Component\Yaml\Dumper;
4
5 /**
6  * Output formatter 'yaml'
7  *
8  * @param $data
9  *   The $data parameter is rendered in yaml
10  * @param $metadata
11  *
12  * Code:
13  *
14  */
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);
24     return $output;
25   }
26 }