. */ namespace SP\Infrastructure\File; /** * Interface FileStorageInterface * * @package SP\Infrastructure\File; */ interface FileCacheInterface { /** * Load file data unserializing the data * * @param string|null $path The path to the file * @param string|null $class The class to unserialize the data * * @return mixed * @throws \SP\Infrastructure\File\FileException */ public function load(?string $path = null, ?string $class = null): mixed; /** * Save file data serializing the data * * @throws FileException */ public function save(mixed $data, ?string $path = null): FileCacheInterface; public function delete(): FileCacheInterface; /** * Returns whether the file is expired */ public function isExpired(int $time = 86400): bool; /** * Returns if the file is expired comparing against a reference date * * @throws FileException */ public function isExpiredDate(int $date): bool; public function exists(): bool; }