| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 7 | protected function loadInternal(array $configs, ContainerBuilder $container): void |
|
| 20 | { |
||
| 21 | 7 | $factoryReference = new Reference(Redis\FactoryInterface::class); |
|
| 22 | 7 | $container->setDefinition($factoryReference, new Definition(Redis\Factory::class)); |
|
| 23 | 7 | ||
| 24 | 7 | foreach ($configs['clients'] as $name => $arguments) { |
|
| 25 | 7 | $definition = new Definition(Redis\Client::class); |
|
| 26 | $definition->setFactory([$factoryReference, 'create']); |
||
| 27 | 7 | $definition->setArguments([$arguments['$parameters'], $arguments['$options']]); |
|
| 28 | $definition->setPublic(true); |
||
| 29 | 7 | ||
| 30 | 7 | $container->setDefinition(sprintf('%s.%s', $this->getAlias(), $name), $definition); |
|
| 31 | |||
| 32 | if (false === $container->hasDefinition(Redis\ClientInterface::class)) { |
||
| 33 | 7 | $container->setDefinition(Redis\ClientInterface::class, $definition); |
|
| 34 | } |
||
| 46 |