| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.0961 |
| 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 | 10 | $services = []; |
|
| 32 | |||
| 33 | 10 | foreach ($ids as $id => $tags) { |
|
| 34 | 10 | foreach ($tags as $tag) { |
|
| 35 | 10 | if (!isset($tag['type'])) { |
|
| 36 | throw new RuntimeException( |
||
| 37 | 'The type attribute must be defined' |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | |||
| 41 | 10 | $services[$tag['type']] = new Reference($id); |
|
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | 10 | $definition->replaceArgument(2, $services); |
|
| 46 | 10 | } |
|
| 48 |