From b7e2cd758f8a4d3840b6d45417b8e793c23c7ac3 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 29 Dec 2022 09:37:45 +0000 Subject: [PATCH] fix: when `retry.json` does not exists --- src/Repositories/TempRepository.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Repositories/TempRepository.php b/src/Repositories/TempRepository.php index 24118551..701aec99 100644 --- a/src/Repositories/TempRepository.php +++ b/src/Repositories/TempRepository.php @@ -60,7 +60,9 @@ final class TempRepository */ private function all(): array { - $contents = file_get_contents(self::FOLDER.'/'.$this->filename.'.json'); + $path = self::FOLDER.'/'.$this->filename.'.json'; + + $contents = file_exists($path) ? file_get_contents($path) : '{}'; assert(is_string($contents));