| 1 | <?php | ||
| 10 | class NamespaceAdapter implements CacheAdapterInterface | ||
| 11 | { | ||
| 12 | /** | ||
| 13 | * @var CacheAdapterInterface | ||
| 14 | */ | ||
| 15 | private $cache; | ||
| 16 | /** | ||
| 17 | * @var string | ||
| 18 | */ | ||
| 19 | private $nsName; | ||
| 20 | /** | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | private $separator; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * @param CacheAdapterInterface $cache | ||
| 27 | * @param $nsName | ||
| 28 | * @param string $separator | ||
| 29 | */ | ||
| 30 | 3 | public function __construct(CacheAdapterInterface $cache, $nsName, $separator = '.') | |
| 36 | |||
| 37 | /** | ||
| 38 | * @param $key | ||
| 39 | * @return mixed|null | ||
| 40 | */ | ||
| 41 | 1 | public function get($key) | |
| 45 | |||
| 46 | /** | ||
| 47 | * @param $key | ||
| 48 | * @param $value | ||
| 49 | */ | ||
| 50 | 1 | public function set($key, $value) | |
| 54 | |||
| 55 | /** | ||
| 56 | * @param $key | ||
| 57 | */ | ||
| 58 | 1 | public function delete($key) | |
| 62 | |||
| 63 | /** | ||
| 64 | * @param $key | ||
| 65 | * @return string | ||
| 66 | */ | ||
| 67 | 3 | private function getKey($key) | |
| 71 | } | ||
| 72 |