| Total Complexity | 11 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CacheerHelper |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param array $item |
||
| 11 | * @param callable|null $exceptionFactory |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public static function validateCacheItem(array $item, ?callable $exceptionFactory = null) |
||
| 15 | { |
||
| 16 | if (!isset($item['cacheKey']) || !isset($item['cacheData'])) { |
||
| 17 | if ($exceptionFactory) { |
||
| 18 | throw $exceptionFactory("Each item must contain 'cacheKey' and 'cacheData'"); |
||
| 19 | } |
||
| 20 | throw new InvalidArgumentException("Each item must contain 'cacheKey' and 'cacheData'"); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param mixed $cacheData |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | public static function mergeCacheData($cacheData) |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param mixed $currentCacheData |
||
| 42 | * @param mixed $cacheData |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData) |
||
| 51 | } |
||
| 52 | } |