Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 4 | public function set(string $key, $value) |
|
35 | { |
||
36 | 4 | $contents = $this->get($key) ?? []; |
|
37 | |||
38 | 4 | if (\is_array($value)) { |
|
39 | 4 | $contents = $value + $contents; |
|
40 | } else { |
||
41 | 1 | $contents[] = $value; |
|
42 | } |
||
43 | |||
44 | 4 | return apcu_store($this->getActualCacheKey($key), $contents, $this->getTtl()); |
|
45 | } |
||
82 |