src/Psr16MemoryCache.php
public function has($key)
    {
        \WildWolf\Cache\Validator::validateKey($key);

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

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

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

        return false;
    }
public function has($key)
    {
        \WildWolf\Cache\Validator::validateKey($key);

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

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

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

        return false;
    }
Determines whether an item is present in the cache.

NOTE: It is recommended that has() is only to be used for cache warming type purposes
and not to be used within your live applications operations for get/set, as this method
is subject to a race condition where your has() will return true and immediately after,
another script can remove it making the state of your app out of date.

@param string $key The cache item key.

@return bool

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