You are here

protected function YamlFileDumper::format 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::format()

Transforms a domain of a message catalogue to its string representation.

Parameters

MessageCatalogue $messages:

string $domain:

Return value

string representation

Overrides FileDumper::format

File

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

Class

YamlFileDumper
YamlFileDumper generates yaml files from a message catalogue.

Namespace

Symfony\Component\Translation\Dumper

Code

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));
}