| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | public function process(ContainerBuilder $container): void |
||
| 11 | { |
||
| 12 | // always first check if the primary service is defined |
||
| 13 | if (!$container->has('mailmotor.manager.subscriber_gateway')) { |
||
| 14 | return; |
||
| 15 | } |
||
| 16 | |||
| 17 | $definition = $container->findDefinition('mailmotor.manager.subscriber_gateway'); |
||
| 18 | |||
| 19 | // find all service IDs with the app.mail_transport tag |
||
| 20 | $taggedServices = $container->findTaggedServiceIds('mailmotor.subscriber_gateway'); |
||
| 21 | |||
| 22 | foreach ($taggedServices as $id => $tags) { |
||
| 23 | // a service could have the same tag twice |
||
| 24 | foreach ($tags as $attributes) { |
||
| 25 | // add the subscriber gateway service to the SubscriberGatewayManager service |
||
| 26 | $definition->addMethodCall( |
||
| 27 | 'addSubscriberGateway', |
||
| 28 | [ |
||
| 29 | $id, |
||
| 30 | $attributes['alias'] |
||
| 31 | ] |
||
| 37 |