Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 2 | public function getClient(string $clientName = RedisPluginConfiguration::CLIENT_DEFAULT): \Redis |
|
34 | { |
||
35 | 2 | if (\array_key_exists($clientName, $this->redisCollection)) { |
|
36 | 1 | return $this->redisCollection[$clientName]; |
|
37 | } |
||
38 | |||
39 | 2 | $config = $this->redisPluginConfiguration->getClientConfiguration($clientName); |
|
40 | 2 | $redis = $this->redisFactory->create($config); |
|
41 | |||
42 | 1 | return $this->redisCollection[$clientName] = $redis; |
|
43 | } |
||
45 |