| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 14 |
| Ratio | 70 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 10 | public function process(ContainerBuilder $container) |
|
| 28 | { |
||
| 29 | 10 | $definition = $container->getDefinition($this->service); |
|
| 30 | 10 | $ids = $container->findTaggedServiceIds($this->tag); |
|
| 31 | |||
| 32 | 10 | View Code Duplication | foreach ($ids as $id => $tags) { |
| 33 | 8 | foreach ($tags as $tag) { |
|
| 34 | 8 | if (!isset($tag['class'])) { |
|
| 35 | 4 | throw new RuntimeException( |
|
| 36 | 4 | 'The class attribute must be defined' |
|
| 37 | ); |
||
| 38 | } |
||
| 39 | |||
| 40 | 4 | $definition->addMethodCall( |
|
| 41 | 4 | 'register', |
|
| 42 | 4 | [$tag['class'], new Reference($id)] |
|
| 43 | ); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | 6 | } |
|
| 47 | } |
||
| 48 |