| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 12 | public function __invoke(ContainerInterface $container): PredisClient |
|
| 19 | { |
||
| 20 | 12 | $config = $container->get('config'); |
|
| 21 | 12 | $redisConfig = $config['cache']['redis'] ?? $config['redis'] ?? []; |
|
| 22 | |||
| 23 | 12 | $servers = $redisConfig['servers'] ?? []; |
|
| 24 | 12 | $servers = is_string($servers) ? explode(',', $servers) : $servers; |
|
| 25 | 12 | $options = count($servers) <= 1 ? null : ['cluster' => 'redis']; |
|
| 26 | |||
| 27 | 12 | return new PredisClient($servers, $options); |
|
| 28 | } |
||
| 30 |