| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getConnection($reset = false) |
||
| 32 | { |
||
| 33 | if (null === $this->connection || true === $reset) { |
||
| 34 | $this->connection = new \Predis\Client(ArrayHelper::merge([ |
||
| 35 | 'scheme' => 'tcp', |
||
| 36 | 'read_write_timeout' => 0, |
||
| 37 | ], [ |
||
| 38 | 'host' => $this->hostname, |
||
| 39 | 'port' => $this->port, |
||
| 40 | 'password' => $this->password, |
||
| 41 | ])); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $this->connection; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |