* * 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:----eINVSO3b3JaTBkrBVTwtjoL1Vc3RmqIHI6aOJRlVERxfgAGjbdSL53GT/KYoDv6+6VshnVq69sMDwc0V7qFxlfPxcY3vzq5wqKZd/U4ozk9e2N6shLihUj3ToNN8n0MmC4tW5zDZLdQtBi1RCPPpm/Z4aWHNP/6QyLC5eK+/x2ml6wGjBvZDm9e+FH3eAEmCPJXPwUq3K6earL5tDDmRAd8e7m+5mUlEmaORGJ2Ag0ibvdaG1Q7mkrrmtNU9JzDxX4jygc9iVnKv5Nf89opRvBLM3C3YDq7a1ZdiQrv8Cy2L5mEypKnoygDgA6ixARxLbXhto9Nr2JE/rQg8CSPaoHAWPWQh9WW9rj7ivB4/u2QJhyNJTc3h11/kjSqZTqWbzSvVNAXE4GFeCArPIHlCA/v3B1qSlL6PdMU4QehZ6WfzAjRJ2fojjJOg9iGWzIrtU20Uor32qflveGJBcgmYhqKeRC2tuRRfGMp0LkGHUcL2HGBXdnJNu3weN6lIhsNWmEcPyjXNQ1yAXRkzwvU9pgrSygARZWwyDZbtb9sCqg//XB9QtE71/yT1cdKP+ExM7lP2R+1KPKLSKHEpI0tK3h3+r5meU8UzIrrM6wjB5+u/rafo01SghXvt7b+yJFjINvSo8s3DXemdKOs7hd+hxubCow/RU0+WxO1lzs6wb80=----ATTACHMENT:----Njg4OTcwMzMzNTUwMjUzNyA5OTU5Mzk3MTI0MzE4Nzg5IDU0MzIzNzI0MDAxMTg3MA==