public function get(CacheKey $k)
{
// @codeCoverageIgnoreStart
if (!$this->enabled) {
throw new NotCachedException();
}
// @codeCoverageIgnoreEnd
if (!is_string($k->sub)) {
$sub = md5(serialize($k->sub));
} else {
$sub = $k->sub;
}
$this->checkValidArgs($k);
$idx = $this->namespace . $k->base . $k->id;
if (isset($this->storage[$idx]) and array_key_exists($sub, $this->storage[$idx])) {
$this->log(CacheLogEnum::ACCESSED, $k);
return $this->storage[$idx][$sub];
}
$this->log(CacheLogEnum::MISSED, $k);
throw new NotCachedException();
}