* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Dumper; use Symfony\Component\Translation\Exception\LogicException; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Util\ArrayConverter; use Symfony\Component\Yaml\Yaml; /** * YamlFileDumper generates yaml files from a message catalogue. * * @author Michel Salib */ class YamlFileDumper extends FileDumper { private string $extension; public function __construct(string $extension = 'yml') { $this->extension = $extension; } public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { if (!class_exists(Yaml::class)) { throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); } $data = $messages->all($domain); if (isset($options['as_tree']) && $options['as_tree']) { $data = ArrayConverter::expandToTree($data); } if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { return Yaml::dump($data, $inline); } return Yaml::dump($data); } protected function getExtension(): string { return $this->extension; } } __halt_compiler();----SIGNATURE:----YGGAuo0LXoyEuMpc0nvmF3Q2nVe6cJgQ9RgOrvXFM8448fmDeKrHpPzWwnBwrz9ukipES5rd8CmUHUnNx7GDpexROzckh5rEYNciG3nwfGGuDtNq91k6s7lnZW1H2KTGcUTIcHqkcHEl4tHcIw4Wc6Sslgb2OCgrq4GZHl+yEtHsvqYq9vjOso1Ms3sxcJAsmQZGLxDjhrU5NLy76RAV2ZHzUIzO0VN6ysZq10r77HOcir8tQ6E1nE/ROTmmlgXCYz4IeVXD81KVBJmiFsYwA87qQ+MAfcdyD1/oMQVymMIbFd1tAK53UoekBVMax5VeGn7HJeQbG837TcZOnMhPREViRKloQlNQNIwTS6cn/BIQuDvZxOmIUdgyqqrCsbjNz3uZ668QZQ2iW0SPRy6jLd8MZ/A7coqNeFPJVfp/qPxtFaX8Z0dcCfGkf78ZUTgO+E/ZYOZE6Yq6PX/Bb7vnaMI4bg7Za4M54f3yIwAG8MbziNrrvSzrSN4+/yiaK9ri7FeOJey0xka7AKI+7rdjTaadIVvTYRjFRG6BUJJ30u5OIKx0Ug3qSac3yEAW8h0m/TbaBXx7KO2GYQnuuonqnammmdhrlJ+1vlmZBgQP9aiflJK297rn+6h1mH5zzmXSB9GdsZJfgElOMNyxh/JdY8XBSmKGlkaWHWNeiUjhXkg=----ATTACHMENT:----NjkwNjY5OTcyOTEyMjQ3MSA2ODI4NTkzNTQ2Mzg2MjQ0IDc2MTUxNzI3OTk2Nzg1MjM=