Generator/YMLFile.php
protected function getYamlBody($yaml_data_array) {
    $yaml_parser = new \Symfony\Component\Yaml\Yaml;

    $yaml_parser_inline_switch_level = $this->component_data['yaml_inline_level'];

    if ($this->component_data['line_break_between_blocks']) {
      $body = [];

      foreach (range(0, count($yaml_data_array) -1 ) as $index) {
        $yaml_slice = array_slice($yaml_data_array, $index, 1);

        // Each YAML piece comes with a terminal newline, so when these are
        // joined there will be the desired blank line between each section.
        $body[] = $yaml_parser->dump($yaml_slice, $yaml_parser_inline_switch_level, static::YAML_INDENT);
      }
    }
    else {
      $yaml = $yaml_parser->dump($yaml_data_array, $yaml_parser_inline_switch_level, static::YAML_INDENT);

      $this->expandInlineItems($yaml_data_array, $yaml);

      // Because the yaml is all built for us, this is just a singleton array.
      $body = array($yaml);
    }
    //drush_print_r($yaml);

    return $body;
  }
protected function getYamlBody($yaml_data_array) {
    $yaml_parser = new \Symfony\Component\Yaml\Yaml;

    $yaml_parser_inline_switch_level = $this->component_data['yaml_inline_level'];

    if ($this->component_data['line_break_between_blocks']) {
      $body = [];

      foreach (range(0, count($yaml_data_array) -1 ) as $index) {
        $yaml_slice = array_slice($yaml_data_array, $index, 1);

        // Each YAML piece comes with a terminal newline, so when these are
        // joined there will be the desired blank line between each section.
        $body[] = $yaml_parser->dump($yaml_slice, $yaml_parser_inline_switch_level, static::YAML_INDENT);
      }
    }
    else {
      $yaml = $yaml_parser->dump($yaml_data_array, $yaml_parser_inline_switch_level, static::YAML_INDENT);

      $this->expandInlineItems($yaml_data_array, $yaml);

      // Because the yaml is all built for us, this is just a singleton array.
      $body = array($yaml);
    }
    //drush_print_r($yaml);

    return $body;
  }
protected function getYamlBody ( $ yaml_data_array ) { $ yaml_parser = new \ Symfony \ Component \ Yaml \ Yaml ; $ yaml_parser_inline_switch_level = $ this -> component_data [ 'yaml_inline_level' ] ; if ( $ this -> component_data [ 'line_break_between_blocks' ] ) { $ body = [ ] ; foreach ( range ( 0 , count ( $ yaml_data_array ) - 1 ) as $ index ) { $ yaml_slice = array_slice ( $ yaml_data_array , $ index , 1 ) ; // Each YAML piece comes with a terminal newline, so when these are // joined there will be the desired blank line between each section. $ body [ ] = $ yaml_parser -> dump ( $ yaml_slice , $ yaml_parser_inline_switch_level , static :: YAML_INDENT ) ; } } else { $ yaml = $ yaml_parser -> dump ( $ yaml_data_array , $ yaml_parser_inline_switch_level , static :: YAML_INDENT ) ; $ this -> expandInlineItems ( $ yaml_data_array , $ yaml ) ; // Because the yaml is all built for us, this is just a singleton array. $ body = array ( $ yaml ) ; } //drush_print_r($yaml); return $ body ; }
Get the YAML body for the file.

@param $yaml_data_array
An array of data to convert to YAML.

@return
An array containing the YAML string.
Get the YAML body for the file .