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

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

            if (null === $expires || (new \DateTime()) < $expires) {
                return $this->createItem($key, $data, $expires);
            }

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

        return new \WildWolf\Cache\CacheItem($key);
    }
public function getItem($key)
    {
        \WildWolf\Cache\Validator::validateKey($key);

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

            if (null === $expires || (new \DateTime()) < $expires) {
                return $this->createItem($key, $data, $expires);
            }

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

        return new \WildWolf\Cache\CacheItem($key);
    }
Returns a Cache Item representing the specified key.

This method must always return a CacheItemInterface object, even in case of
a cache miss. It MUST NOT return null.

@param string $key
The key for which to return the corresponding Cache Item.

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

@return \Psr\Cache\CacheItemInterface
The corresponding Cache Item.