* * 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:----WiUv0qJabFu49qzRSDPKl0D8QZIo5I6IWRnZLd2SSnDA+iHAkobkhmbXCF1ALOeuC/J+uPexTlkU9hbl+mC/Pm5cktM3uhDvONtgKms88RSwO5R4FBrWnw0G0O69aAfE8rGbAzicc5uJodxrJZM11xBuYcESP5+/We03qaaUhFhRY/pQm4vvx9gpSK/H57IsaFyaojbwrUQaBflS7to58qt45ta4QB+DVQ1CXqKFuvbW9oC60tI+c0ArNCgeBRn4ZLKJbkEyiX3C1oSk1yOq1u2cS2IE0j3nQmIt09N5wWp4FlAOuUN8mkjGdmBwRIuFjs8pCBdD7R7GlUpYA3TZ7kDUSy7vP9AQX70vt+hJpx71bMBLaprVsLJViLXU33z+AZ2IcAa0zZ6VDGezW9Ti0Z4xtgrhb4W6HoKBFRM3CTCcCL+8h1v7lT4MxawAikUHgnyFFvJTMGbK98m2okGRVvs8Z0T+4hWm9ITDTOAqmVbmN/8V1f49iDCgbooGrKxNIMKnpu9MN8S0/i0DbwnZIBH5SaBh5Qpa+/uLKhOBSTuBJUzJfeJpLJu0LG8yf5Nn1gi3yw54jLndbFlPtb8KKD2IcUb+N7sPKSYb7XLfsOhKufZbovKy4Z7YxVVPt08rBJVUvpET/qznGUbSh+1CVm8el23FqyCdDbAodJO6V4A=----ATTACHMENT:----NjEzMDUwOTY4NzAzMDU3NiA1MTMxNDA3NDg1NjEzNzAyIDg3MjQ3MjMwNDEwMDA5Mjg=