SymfonyComponentTranslationDumperYamlFileDumper

YamlFileDumper generates yaml files from a message catalogue.

Defined (1)

The class is defined in the following location(s).

/vendor/symfony/translation/Dumper/YamlFileDumper.php  
  1. class YamlFileDumper extends FileDumper 
  2. /** 
  3. * {@inheritdoc} 
  4. */ 
  5. public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array()) 
  6. if (!class_exists('Symfony\Component\Yaml\Yaml')) { 
  7. throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); 
  8.  
  9. $data = $messages->all($domain); 
  10.  
  11. if (isset($options['as_tree']) && $options['as_tree']) { 
  12. $data = ArrayConverter::expandToTree($data); 
  13.  
  14. if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { 
  15. return Yaml::dump($data, $inline); 
  16.  
  17. return Yaml::dump($data); 
  18.  
  19. /** 
  20. * {@inheritdoc} 
  21. */ 
  22. protected function getExtension() 
  23. return 'yml';