| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 8.125 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 1 | public function process(ContainerBuilder $container) |
|
| 13 | { |
||
| 14 | 1 | if (!$container->has('bankiru.seo.source_registry')) { |
|
| 15 | return; |
||
| 16 | } |
||
| 17 | |||
| 18 | 1 | $registry = $container->getDefinition('bankiru.seo.source_registry'); |
|
| 19 | 1 | $services = $container->findTaggedServiceIds('seo_source'); |
|
| 20 | |||
| 21 | 1 | foreach ($services as $id => $tags) { |
|
| 22 | foreach ($tags as $attributes) { |
||
| 23 | if (!array_key_exists('code', $attributes)) { |
||
| 24 | throw new \RuntimeException(sprintf('No code configured for %s' . $id)); |
||
| 25 | } |
||
| 26 | $code = $attributes['code']; |
||
| 27 | |||
| 28 | $registry->addMethodCall('add', [$code, new Reference($id)]); |
||
| 29 | } |
||
| 30 | 1 | } |
|
| 31 | 1 | } |
|
| 32 | } |
||
| 33 |