From b5473636464a7218e5e1b2dd41b0677798c383b0 Mon Sep 17 00:00:00 2001 From: David Ferbr Date: Mon, 2 Dec 2019 14:17:48 +0100 Subject: [PATCH] make doSaveDependingOnFiles() nullable again addresses https://github.com/Kdyby/DoctrineCache/issues/23 --- src/Cache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cache.php b/src/Cache.php index d66ac38..cb940b8 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -102,8 +102,9 @@ protected function doSave($id, $data, $lifeTime = 0): bool * @param string[] $files * @param int $lifeTime */ - protected function doSaveDependingOnFiles(string $id, $data, array $files, int $lifeTime = 0): bool + protected function doSaveDependingOnFiles(string $id, $data, array $files, int $lifeTime = null): bool { + $lifeTime = (int) $lifeTime; $dp = [NCache::TAGS => ['doctrine'], NCache::FILES => $files]; if ($lifeTime > 0) { $dp[NCache::EXPIRE] = time() + $lifeTime;