| @@ 26-34 (lines=9) @@ | ||
| 23 | return $this->values[$key]; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function add($key, $value, $ttl) |
|
| 27 | { |
|
| 28 | if ($this->exists($key)) { |
|
| 29 | return false; |
|
| 30 | } |
|
| 31 | ||
| 32 | $this->values[$key] = $value; |
|
| 33 | return true; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function delete($key) |
|
| 37 | { |
|
| @@ 36-44 (lines=9) @@ | ||
| 33 | return true; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function delete($key) |
|
| 37 | { |
|
| 38 | if (!$this->exists($key)) { |
|
| 39 | return false; |
|
| 40 | } |
|
| 41 | ||
| 42 | unset($this->values[$key]); |
|
| 43 | return true; |
|
| 44 | } |
|
| 45 | ||
| 46 | protected function exists($key) |
|
| 47 | { |
|