| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 9.3088 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | 4 | public function process(ContainerBuilder $container) |
|
| 14 | { |
||
| 15 | 4 | $registry = $container->getDefinition(Collector::REGISTRY_ID); |
|
| 16 | |||
| 17 | 4 | $services = $container->findTaggedServiceIds(Collector::TAG); |
|
| 18 | 4 | foreach ($services as $id => $tags) { |
|
| 19 | foreach ($tags as $attributes) { |
||
| 20 | if (!isset($attributes[Collector::ALIAS_ATTRIBUTE])) { |
||
| 21 | throw new \InvalidArgumentException( |
||
| 22 | sprintf( |
||
| 23 | 'Missing "%s" attribute for "%s" tag "%s"', |
||
| 24 | Collector::ALIAS_ATTRIBUTE, |
||
| 25 | $id, |
||
| 26 | Collector::TAG |
||
| 27 | ) |
||
| 28 | ); |
||
| 29 | } |
||
| 30 | |||
| 31 | $registry->addMethodCall('register', [$attributes[Collector::ALIAS_ATTRIBUTE], new Reference($id)]); |
||
| 32 | } |
||
| 36 |