| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.0961 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 4 | public function process(ContainerBuilder $container) |
|
| 19 | { |
||
| 20 | 4 | $definition = $container->getDefinition('innmind_neo4j.metadata_builder'); |
|
| 21 | 4 | $ids = $container->findTaggedServiceIds('innmind_neo4j.metadata_factory'); |
|
| 22 | 4 | $services = []; |
|
| 23 | |||
| 24 | 4 | foreach ($ids as $id => $tags) { |
|
| 25 | 4 | foreach ($tags as $tag) { |
|
| 26 | 4 | if (!isset($tag['type'])) { |
|
| 27 | throw new RuntimeException( |
||
| 28 | 'The type attribute must be defined' |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | 4 | $services[$tag['type']] = new Reference($id); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 4 | $definition->replaceArgument(1, $services); |
|
| 37 | 4 | } |
|
| 39 |