Total Complexity | 3 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | abstract class AbstractValue |
||
8 | { |
||
9 | private static array $cache = []; |
||
10 | |||
11 | 12 | protected static function cacheRetrieve($key): ?object |
|
12 | { |
||
13 | 12 | return self::$cache[self::getCacheKey($key)] ?? null; |
|
14 | } |
||
15 | |||
16 | 4 | protected static function cacheStore($key, object $object): void |
|
17 | { |
||
18 | 4 | self::$cache[self::getCacheKey($key)] = $object; |
|
19 | 4 | } |
|
20 | |||
21 | 12 | private static function getCacheKey($key): string |
|
24 | } |
||
25 | } |
||
26 |