| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 1 | public function process(ContainerBuilder $container) |
|
| 10 | { |
||
| 11 | 1 | if ($class = $this->config->get('indexer_backend')) { |
|
| 12 | 1 | if (strpos($class, '_') === false) { |
|
| 13 | // Built-in backend called using the shorthand notation |
||
| 14 | 1 | $class = "midcom_services_indexer_backend_" . $class; |
|
| 15 | } |
||
| 16 | |||
| 17 | 1 | $backend = $container->getDefinition('indexer.backend'); |
|
| 18 | 1 | $backend->setClass($class); |
|
| 19 | 1 | $indexer = $container->getDefinition('indexer'); |
|
| 20 | 1 | $indexer->addArgument(new Reference('indexer.backend')); |
|
| 21 | |||
| 22 | 1 | $container->getDefinition('event_dispatcher') |
|
| 23 | 1 | ->addMethodCall('addSubscriber', [new Reference('indexer')]); |
|
| 24 | } |
||
| 26 | } |