. */ namespace SP\Domain\Storage\Ports; use SP\Infrastructure\File\FileException; /** * Interface FileCacheService */ interface FileCacheService { /** * @throws FileException */ public function load(?string $path = null): mixed; /** * @template T * * @param class-string $class * @return T * @throws FileException */ public function loadWith(string $class): object; /** * Save file data serializing the data * * @throws FileException */ public function save(mixed $data, ?string $path = null): FileCacheService; public function delete(): FileCacheService; /** * 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; }