Conditions | 3 |
Paths | 4 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.3332 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | 1 | protected function save(string $name, $data) |
|
44 | { |
||
45 | 1 | if ($this->ttl > 0) { |
|
46 | 1 | $saved = $this->redis->setEx($this->prefix . $name, $this->ttl, $data); |
|
47 | } else { |
||
48 | $saved = $this->redis->set($this->prefix . $name, $data); |
||
49 | } |
||
50 | 1 | if (!$saved) { |
|
51 | throw new \RuntimeException('Unable to save allowance: ' . $this->redis->getLastError()); |
||
52 | } |
||
55 |