| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 31 | protected function createConnection(): object |
||
| 32 | { |
||
| 33 | $hosts = \getenv('REDIS_CLUSTER_HOSTS'); |
||
| 34 | $connection = RedisAdapter::createConnection('redis:?host['.\str_replace(' ', ']&host[', $hosts).']', ['lazy' => true, 'redis_cluster' => true]); |
||
| 35 | |||
| 36 | if (!$connection instanceof RedisClusterProxy) { |
||
| 37 | throw new \RuntimeException('Expected instance of '.RedisClusterProxy::class); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $connection; |
||
| 41 | } |
||
| 43 |