independent-analytics
/
vendor
/
symfony
/
translation
/
DependencyInjection
/
TranslationDumperPass.php
TranslationDumperPass.php
1 month ago
TranslationExtractorPass.php
1 month ago
TranslatorPass.php
1 month ago
TranslatorPathsPass.php
1 month ago
TranslationDumperPass.php
33 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\DependencyInjection; |
| 12 | |
| 13 | use IAWPSCOPED\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
| 14 | use IAWPSCOPED\Symfony\Component\DependencyInjection\ContainerBuilder; |
| 15 | use IAWPSCOPED\Symfony\Component\DependencyInjection\Reference; |
| 16 | /** |
| 17 | * Adds tagged translation.formatter services to translation writer. |
| 18 | * @internal |
| 19 | */ |
| 20 | class TranslationDumperPass implements CompilerPassInterface |
| 21 | { |
| 22 | public function process(ContainerBuilder $container) |
| 23 | { |
| 24 | if (!$container->hasDefinition('translation.writer')) { |
| 25 | return; |
| 26 | } |
| 27 | $definition = $container->getDefinition('translation.writer'); |
| 28 | foreach ($container->findTaggedServiceIds('translation.dumper', \true) as $id => $attributes) { |
| 29 | $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 |