Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
67 | public function getClient(): Redis |
||
68 | { |
||
69 | if (is_null($this->instance)) { |
||
70 | try { |
||
71 | $this->instance = new Redis(); |
||
72 | $this->instance->connect( |
||
73 | $this->config[self::_HOST], |
||
74 | $this->config[self::_PORT] |
||
75 | ); |
||
76 | } catch (\RedisException $e) { |
||
77 | $this->error = true; |
||
78 | $this->errorCode = $e->getCode(); |
||
79 | $this->errorMessage = $e->getMessage(); |
||
80 | } |
||
81 | } |
||
82 | return $this->instance; |
||
83 | } |
||
115 |