Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | private function loadDependency(ContainerBuilder $container, $serviceId, $position) |
||
32 | { |
||
33 | if (!$container->hasDefinition($serviceId)) { |
||
34 | return; |
||
35 | } |
||
36 | $services = $container->findTaggedServiceIds('benat_espina_i18n_routing.not_found_locale_resolver'); |
||
37 | if (count($services) === 0) { |
||
38 | return; |
||
39 | } |
||
40 | |||
41 | if (count($services) > 1) { |
||
42 | throw new \LogicException( |
||
43 | 'Only one service can have the "benat_espina_i18n_routing.not_found_locale_resolver" tag.' |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | $container->findDefinition($serviceId)->replaceArgument($position, $container->getDefinition(key($services))); |
||
48 | } |
||
49 | } |
||
50 |