CsvFileDumper.php
1 month ago
DumperInterface.php
2 years ago
FileDumper.php
1 month ago
IcuResFileDumper.php
1 month ago
IniFileDumper.php
1 month ago
JsonFileDumper.php
1 month ago
MoFileDumper.php
1 month ago
PhpFileDumper.php
1 month ago
PoFileDumper.php
1 month ago
QtFileDumper.php
1 month ago
XliffFileDumper.php
1 month ago
YamlFileDumper.php
1 month ago
PhpFileDumper.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace IAWPSCOPED\Symfony\Component\Translation\Dumper; |
| 12 | |
| 13 | use IAWPSCOPED\Symfony\Component\Translation\MessageCatalogue; |
| 14 | /** |
| 15 | * PhpFileDumper generates PHP files from a message catalogue. |
| 16 | * |
| 17 | * @author Michel Salib <michelsalib@hotmail.com> |
| 18 | * @internal |
| 19 | */ |
| 20 | class PhpFileDumper extends FileDumper |
| 21 | { |
| 22 | /** |
| 23 | * {@inheritdoc} |
| 24 | */ |
| 25 | public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) : string |
| 26 | { |
| 27 | return "<?php\n\nreturn " . \var_export($messages->all($domain), \true) . ";\n"; |
| 28 | } |
| 29 | /** |
| 30 | * {@inheritdoc} |
| 31 | */ |
| 32 | protected function getExtension() : string |
| 33 | { |
| 34 | return 'php'; |
| 35 | } |
| 36 | } |
| 37 |