| Conditions | 3 |
| Paths | 4 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | 2 | protected function save(string $name, $data) |
|
| 46 | { |
||
| 47 | 2 | if ($this->ttl > 0) { |
|
| 48 | 1 | $saved = $this->conn->setEx($this->getKey($name), $this->ttl, $data); |
|
| 49 | } else { |
||
| 50 | 1 | $saved = $this->conn->set($this->getKey($name), $data); |
|
| 51 | } |
||
| 52 | 2 | if (!$saved) { |
|
| 53 | throw new \RuntimeException($this->conn->getLastError()); |
||
| 54 | } |
||
| 62 |