Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | class CacheRedisHelper |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * serializes or unserializes data based on the $serialize flag. |
||
18 | * |
||
19 | * @param mixed $data |
||
20 | * @param bool $serialize |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public static function serialize(mixed $data, bool $serialize = true): mixed |
||
30 | |||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Validates a cache item. |
||
35 | * |
||
36 | * @param array $item |
||
37 | * @return void |
||
38 | */ |
||
39 | public static function validateCacheItem(array $item): void |
||
40 | { |
||
41 | CacheerHelper::validateCacheItem( |
||
42 | $item, |
||
43 | fn($msg) => CacheRedisException::create($msg) |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Merges cache data with existing data. |
||
49 | * |
||
50 | * @param $cacheData |
||
51 | * @return array |
||
52 | */ |
||
53 | public static function mergeCacheData($cacheData): array |
||
54 | { |
||
55 | return CacheerHelper::mergeCacheData($cacheData); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Generates an array identifier for cache data. |
||
60 | * |
||
61 | * @param mixed $currentCacheData |
||
62 | * @param mixed $cacheData |
||
63 | * @return array |
||
64 | */ |
||
65 | public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData): array |
||
68 | } |
||
69 | |||
70 | } |
||
72 |