Skip to content

Commit

Permalink
Merge pull request #386 from bartmcleod/5.0
Browse files Browse the repository at this point in the history
Fix for #385 fix service configuration
  • Loading branch information
bartmcleod authored Feb 10, 2021
2 parents 940300f + 71e0355 commit abca4bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions DependencyInjection/Compiler/TranslatorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Lexik\Bundle\TranslationBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
Expand Down Expand Up @@ -40,7 +41,7 @@ public function process(ContainerBuilder $container)
$serviceRefs = array_merge($loadersReferencesById, array('event_dispatcher' => new Reference('event_dispatcher')));

$container->findDefinition('lexik_translation.translator')
->replaceArgument(0, \Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass::register($container, $serviceRefs))
->replaceArgument(0, ServiceLocatorTagPass::register($container, $serviceRefs))
->replaceArgument(3, $loaders);
} else {
$container->findDefinition('lexik_translation.translator')->replaceArgument(2, $loaders);
Expand All @@ -52,9 +53,9 @@ public function process(ContainerBuilder $container)
}

// exporters
if ($container->hasDefinition('lexik_translation.exporter_collector')) {
if ($container->hasDefinition('Lexik\Bundle\TranslationBundle\Translation\Exporter\ExporterCollector')) {
foreach ($container->findTaggedServiceIds('lexik_translation.exporter') as $id => $attributes) {
$container->getDefinition('lexik_translation.exporter_collector')->addMethodCall('addExporter', array($id, new Reference($id)));
$container->getDefinition('Lexik\Bundle\TranslationBundle\Translation\Exporter\ExporterCollector')->addMethodCall('addExporter', array($id, new Reference($id)));
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,27 @@
<service id="Lexik\Bundle\TranslationBundle\Translation\Exporter\ExporterCollector" class="%lexik_translation.exporter_collector.class%"/>
<service id="lexik_translation.exporter_collector" alias="Lexik\Bundle\TranslationBundle\Translation\Exporter\ExporterCollector" public="true"/>

<service id="lexik_translation.exporter.xliff" class="%lexik_translation.exporter.xliff.class%">
<service id="Lexik\Bundle\TranslationBundle\Translation\Exporter\XliffExporter" class="%lexik_translation.exporter.xliff.class%">
<tag name="lexik_translation.exporter" alias="xlf" />
</service>
<service id="lexik_translation.exporter.xliff" alias="Lexik\Bundle\TranslationBundle\Translation\Exporter\XliffExporter" public="true"/>

<service id="lexik_translation.exporter.json" class="%lexik_translation.exporter.json.class%">
<service id="Lexik\Bundle\TranslationBundle\Translation\Exporter\JsonExporter" class="%lexik_translation.exporter.json.class%">
<argument>%lexik_translation.exporter.json.hierarchical_format%</argument>
<tag name="lexik_translation.exporter" alias="json" />
</service>
<service id="lexik_translation.exporter.json" alias="Lexik\Bundle\TranslationBundle\Translation\Exporter\JsonExporter" public="true"/>

<service id="lexik_translation.exporter.yml" class="%lexik_translation.exporter.yml.class%">
<service id="Lexik\Bundle\TranslationBundle\Translation\Exporter\YamlExporter" class="%lexik_translation.exporter.yml.class%">
<argument>%lexik_translation.exporter.yml.use_tree%</argument>
<tag name="lexik_translation.exporter" alias="yml" />
</service>
<service id="lexik_translation.exporter.yml" alias="Lexik\Bundle\TranslationBundle\Translation\Exporter\YamlExporter"/>

<service id="lexik_translation.exporter.php" class="%lexik_translation.exporter.php.class%">
<service id="Lexik\Bundle\TranslationBundle\Translation\Exporter\PhpExporter" class="%lexik_translation.exporter.php.class%">
<tag name="lexik_translation.exporter" alias="php" />
</service>
<service id="lexik_translation.exporter.php" alias="Lexik\Bundle\TranslationBundle\Translation\Exporter\PhpExporter"/>

<!-- Data grid -->
<service id="lexik_translation.data_grid.formatter" class="%lexik_translation.data_grid.formatter.class%" public="true">
Expand Down

0 comments on commit abca4bb

Please sign in to comment.