| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| 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 | |||
| 38 | if (count($services) > 1) { |
||
| 39 | throw new \LogicException( |
||
| 40 | 'Only one service can have the "benat_espina_i18n_routing.not_found_locale_resolver" tag.' |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 44 | $container->findDefinition($serviceId)->replaceArgument($position, $container->getDefinition(key($services))); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |