PHPDaemon\Cache\CappedStorage::get PHP Method

get() public method

Gets element by key
public get ( string $key ) : object
$key string Key
return object Item
    public function get($key)
    {
        $k = $this->hash($key);
        if (!isset($this->cache[$k])) {
            return null;
        }
        $item = $this->cache[$k];
        if (isset($item->expire)) {
            if (microtime(true) >= $item->expire) {
                unset($this->cache[$k]);
                return null;
            }
        }
        return $item;
    }