You are here

class YamlFileDumper in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Dumper/YamlFileDumper.php \Symfony\Component\Translation\Dumper\YamlFileDumper

YamlFileDumper generates yaml files from a message catalogue.

@author Michel Salib <michelsalib@hotmail.com>

Hierarchy

Expanded class hierarchy of YamlFileDumper

1 file declares its use of YamlFileDumper
YamlFileDumperTest.php in vendor/symfony/translation/Tests/Dumper/YamlFileDumperTest.php

File

vendor/symfony/translation/Dumper/YamlFileDumper.php, line 22

Namespace

Symfony\Component\Translation\Dumper
View source
class YamlFileDumper extends FileDumper {

  /**
   * {@inheritdoc}
   */
  protected function format(MessageCatalogue $messages, $domain) {
    if (!class_exists('Symfony\\Component\\Yaml\\Yaml')) {
      throw new \LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.');
    }
    return Yaml::dump($messages
      ->all($domain));
  }

  /**
   * {@inheritdoc}
   */
  protected function getExtension() {
    return 'yml';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FileDumper::$backup private property Make file backup before the dump.
FileDumper::$relativePathTemplate protected property A template for the relative paths to files. 1
FileDumper::dump public function Dumps the message catalogue. Overrides DumperInterface::dump 1
FileDumper::getRelativePath private function Gets the relative file path using the template.
FileDumper::setBackup public function Sets backup flag.
FileDumper::setRelativePathTemplate public function Sets the template for the relative paths to files.
YamlFileDumper::format protected function Transforms a domain of a message catalogue to its string representation. Overrides FileDumper::format
YamlFileDumper::getExtension protected function Gets the file extension of the dumper. Overrides FileDumper::getExtension