| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class ArrayCacheKeyspace |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param string $cacheKey |
||
| 12 | * @param string $namespace |
||
| 13 | * @return string |
||
| 14 | */ |
||
| 15 | public function build(string $cacheKey, string $namespace = ''): string |
||
| 16 | { |
||
| 17 | return $namespace !== '' ? ($namespace . ':' . $cacheKey) : $cacheKey; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param string $arrayStoreKey |
||
| 22 | * @return array{0:string,1:string} |
||
| 23 | */ |
||
| 24 | public function split(string $arrayStoreKey): array |
||
| 25 | { |
||
| 26 | $parts = explode(':', $arrayStoreKey, 2); |
||
| 27 | if (count($parts) === 2) { |
||
| 28 | return [$parts[0], $parts[1]]; |
||
| 29 | } |
||
| 30 | return ['', $arrayStoreKey]; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param array $cacheData |
||
| 35 | * @return bool |
||
| 36 | */ |
||
| 37 | public function isExpired(array $cacheData): bool |
||
| 42 | } |
||
| 43 | } |
||
| 44 |