Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
31 | public function set($key, $value): void |
||
32 | { |
||
33 | $cacheEntry = [ |
||
34 | 'key' => $key, |
||
35 | 'value' => $value, |
||
36 | ]; |
||
37 | $index = $this->findCacheIndexByKey($key); |
||
38 | |||
39 | if ($index !== null) { |
||
40 | $this->cache[$index] = $cacheEntry; |
||
41 | |||
42 | return; |
||
43 | } |
||
44 | |||
45 | $this->cache[] = $cacheEntry; |
||
46 | } |
||
47 | |||
89 |