composer package updates
[openemr.git] / vendor / symfony / translation / Dumper / JsonFileDumper.php
blob08b538e1fec835b2ef0a05e18854cf25498bf14a
1 <?php
3 /*
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation\Dumper;
14 use Symfony\Component\Translation\MessageCatalogue;
16 /**
17 * JsonFileDumper generates an json formatted string representation of a message catalogue.
19 * @author singles
21 class JsonFileDumper extends FileDumper
23 /**
24 * {@inheritdoc}
26 public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
28 if (isset($options['json_encoding'])) {
29 $flags = $options['json_encoding'];
30 } else {
31 $flags = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
34 return json_encode($messages->all($domain), $flags);
37 /**
38 * {@inheritdoc}
40 protected function getExtension()
42 return 'json';