| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function process(ContainerBuilder $container) |
||
| 29 | { |
||
| 30 | if (!$container->hasDefinition('link_value_mobile_notif.clients')) { |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | |||
| 34 | $clientCollectionService = $container->getDefinition('link_value_mobile_notif.clients'); |
||
| 35 | $taggedClientServices = $container->findTaggedServiceIds('link_value_mobile_notif.client'); |
||
| 36 | |||
| 37 | foreach ($taggedClientServices as $serviceId => $attributes) { |
||
| 38 | foreach ($attributes as $attribute) { |
||
| 39 | if (empty($attribute['name'])) { |
||
| 40 | throw new \InvalidArgumentException('"link_value_mobile_notif.client" tag must define "name" key.'); |
||
| 41 | } |
||
| 42 | |||
| 43 | $clientCollectionService->addMethodCall('addClient', array( |
||
| 44 | $attribute['name'], |
||
| 45 | new Reference($serviceId), |
||
| 46 | )); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 | } |
||
| 51 |