. */ namespace SP\Storage\File; /** * Class FileCache * * @package SP\Storage\File; */ final class FileCache extends FileCacheBase { /** * @return mixed * @throws FileException */ public function load() { return unserialize($this->path->checkIsReadable()->readToString()); } /** * @param mixed $data * * @return FileCacheInterface * @throws FileException */ public function save($data) { $this->createPath(); $this->path->checkIsWritable() ->write(serialize($data)) ->close(); return $this; } }