public function get($key, $default = null)
    {
        \WildWolf\Cache\Validator::validateKey($key);

        if (isset($this->cache[$key])) {
            list($data, $expires) = $this->cache[$key];

            if (null === $expires || (new \DateTime()) < $expires) {
                return $data;
            }

            unset($this->cache[$key]);
        }

        return $default;
    }
public function get($key, $default = null)
    {
        \WildWolf\Cache\Validator::validateKey($key);

        if (isset($this->cache[$key])) {
            list($data, $expires) = $this->cache[$key];

            if (null === $expires || (new \DateTime()) < $expires) {
                return $data;
            }

            unset($this->cache[$key]);
        }

        return $default;
    }
public function get ( $ key , $ default = null ) { \ WildWolf \ Cache \ Validator :: validateKey ( $ key ) ; if ( isset ( $ this -> cache [ $ key ] ) ) { list ( $ data , $ expires ) = $ this -> cache [ $ key ] ; if ( null === $ expires || ( new \ DateTime ( ) ) < $ expires ) { return $ data ; } unset ( $ this -> cache [ $ key ] ) ; } return $ default ; }
Fetches a value from the cache.

@param string $key     The unique key of this item in the cache.
@param mixed  $default Default value to return if the key does not exist.

@return mixed The value of the item from the cache, or $default in case of cache miss.

@throws \Psr\SimpleCache\InvalidArgumentException
MUST be thrown if the $key string is not a legal value.
Fetches a value from the cache .