| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 6 | public function process(ContainerBuilder $container) |
|
| 19 | { |
||
| 20 | 6 | $ids = $container->findTaggedServiceIds('innmind_neo4j.identity.generator'); |
|
| 21 | 6 | $definition = $container->getDefinition('innmind_neo4j.generators'); |
|
| 22 | 6 | $generators = []; |
|
| 23 | |||
| 24 | 6 | foreach ($ids as $id => $tags) { |
|
| 25 | 4 | foreach ($tags as $attributes) { |
|
| 26 | 4 | if (!isset($attributes['generates'])) { |
|
| 27 | 2 | throw new LogicException(sprintf( |
|
| 28 | 2 | 'The "generates" attribute must be set for "%s"', |
|
| 29 | 2 | $id |
|
| 30 | )); |
||
| 31 | } |
||
| 32 | |||
| 33 | 2 | $generators[$attributes['generates']] = new Reference($id); |
|
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | 4 | $definition->replaceArgument(2, $generators); |
|
| 38 | 4 | } |
|
| 40 |