| Conditions | 6 |
| Paths | 5 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function process(ContainerBuilder $container): void |
||
| 18 | { |
||
| 19 | $metaTagHandlers = $container->findTaggedServiceIds('netgen_open_graph.meta_tag_handler'); |
||
| 20 | if (!empty($metaTagHandlers) && $container->hasDefinition('netgen_open_graph.handler_registry')) { |
||
| 21 | $handlerRegistry = $container->getDefinition('netgen_open_graph.handler_registry'); |
||
| 22 | foreach ($metaTagHandlers as $serviceId => $metaTagHandler) { |
||
| 23 | foreach ($metaTagHandler as $tag) { |
||
| 24 | if (!isset($tag['alias'])) { |
||
| 25 | throw new LogicException( |
||
| 26 | 'netgen_open_graph.meta_tag_handler service tag needs an "alias" attribute to identify the handler. None given.' |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | $handlerRegistry->addMethodCall( |
||
| 31 | 'addHandler', |
||
| 32 | [ |
||
| 33 | $tag['alias'], |
||
| 34 | new Reference($serviceId), |
||
| 35 | ] |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |
||
| 42 |