Total Complexity | 6 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | final class CacheKeyNormalizer |
||
18 | { |
||
19 | /** |
||
20 | * Normalizes cache key from a given key. |
||
21 | * |
||
22 | * If the given key is a string containing alphanumeric characters only and no more than 32 characters, |
||
23 | * then the key will be returned back as it is, integers will be converted to strings. Otherwise, |
||
24 | * a normalized key is generated by serializing the given key and applying MD5 hashing. |
||
25 | * |
||
26 | * @param mixed $key The key to be normalized. |
||
27 | * @return string The normalized cache key. |
||
28 | */ |
||
29 | 12 | public function normalize($key): string |
|
43 |