Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function process(ContainerBuilder $container) |
||
28 | { |
||
29 | try { |
||
30 | $loaderProvider = $container->findDefinition('sylius.theme.translation.loader_provider'); |
||
31 | } catch (\InvalidArgumentException $exception) { |
||
32 | return; |
||
33 | } |
||
34 | |||
35 | $taggedServices = $container->findTaggedServiceIds('translation.loader'); |
||
36 | $loaders = []; |
||
37 | foreach ($taggedServices as $id => $attributes) { |
||
38 | $loader = $container->findDefinition($id); |
||
39 | $loader->setLazy(true); |
||
40 | |||
41 | $loaders[$attributes[0]['alias']] = new Reference($id); |
||
42 | |||
43 | if (isset($attributes[0]['legacy-alias'])) { |
||
44 | $loaders[$attributes[0]['legacy-alias']] = new Reference($id); |
||
45 | } |
||
46 | } |
||
47 | |||
48 | $loaderProvider->replaceArgument(0, $loaders); |
||
49 | } |
||
50 | } |
||
51 |