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