Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 2 | protected function getRedis(): \Redis |
|
37 | { |
||
38 | 2 | if ($this->redis === null) { |
|
39 | 2 | $this->redis = new \Redis(); |
|
40 | 2 | $this->redis->connect($this->hostname, $this->port); |
|
41 | 2 | if ($this->password !== '') { |
|
42 | $this->redis->auth($this->password); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | 2 | return $this->redis; |
|
47 | } |
||
49 |