src/Perry/Cache/File/FilePool.php
public function getItem($key)
    {
        // no check for legality atm, since we can use everything as a key
        // usually you want that to reflect the limitations put in place by psr-6
        $map = self::mapKey($key);

        if (!file_exists($this->path .'/'. $map['dir'])) {
            mkdir($this->path .'/'. $map['dir']);
        }

        return FileItem::fromFile($this->path .'/'. $map['dir'] . '/' . $map['file'], $key);
    }
public function getItem($key)
    {
        // no check for legality atm, since we can use everything as a key
        // usually you want that to reflect the limitations put in place by psr-6
        $map = self::mapKey($key);

        if (!file_exists($this->path .'/'. $map['dir'])) {
            mkdir($this->path .'/'. $map['dir']);
        }

        return FileItem::fromFile($this->path .'/'. $map['dir'] . '/' . $map['file'], $key);
    }
Returns a Cache Item representing the specified key.

This method must always return an ItemInterface 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.
@return \Psr\Cache\ItemInterface
The corresponding Cache Item.
@throws \Psr\Cache\InvalidArgumentException
If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException
MUST be thrown.