| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function get(string $key) |
||
| 22 | { |
||
| 23 | if (!isset($this->data[$key])) { |
||
| 24 | return null; |
||
| 25 | } |
||
| 26 | |||
| 27 | if (!isset($this->timeToLive[$key])) { |
||
| 28 | return $this->data[$key]; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($this->ttl($key) > 0) { |
||
| 32 | return $this->data[$key]; |
||
| 33 | } |
||
| 34 | |||
| 35 | unset($this->timeToLive[$key], $this->data[$key]); |
||
| 36 | return null; |
||
| 37 | } |
||
| 88 | } |