| Conditions | 5 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 6 | public function process(ContainerBuilder $container) |
|
| 23 | { |
||
| 24 | 6 | if (!$container->hasDefinition('toothless.lazy_image.converter_manager')) { |
|
| 25 | 1 | return; |
|
| 26 | } |
||
| 27 | |||
| 28 | 5 | $definition = $container->getDefinition('toothless.lazy_image.converter_manager'); |
|
| 29 | 5 | $services = $container->findTaggedServiceIds('toothless.lazy_image.converter'); |
|
| 30 | |||
| 31 | 5 | foreach ($services as $id => $tags) { |
|
| 32 | 4 | foreach ($tags as $attributes) { |
|
| 33 | 4 | $name = isset($attributes['alias']) ? $attributes['alias'] : $id; |
|
| 34 | 4 | $definition->addMethodCall('addConverter', [$name, new Reference($id)]); |
|
| 35 | 4 | } |
|
| 36 | 5 | } |
|
| 37 | 5 | } |
|
| 38 | } |
||
| 39 |