From c9d7a69ecbc28dcc6660cb35322800b5c6d61eff Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 16 Aug 2019 17:14:18 +0100 Subject: [PATCH 1/2] Fixed incorrect implementation of PSR-16 --- src/Illuminate/Cache/Repository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Cache/Repository.php b/src/Illuminate/Cache/Repository.php index 5a2757e97dc7..bbf6007154eb 100755 --- a/src/Illuminate/Cache/Repository.php +++ b/src/Illuminate/Cache/Repository.php @@ -199,7 +199,7 @@ public function put($key, $value, $minutes = null) */ public function set($key, $value, $ttl = null) { - $this->put($key, $value, $ttl); + $this->put($key, $value, $ttl === null ? null : $ttl / 60); } /** @@ -225,7 +225,7 @@ public function putMany(array $values, $minutes) */ public function setMultiple($values, $ttl = null) { - $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl); + $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl === null ? null : $ttl / 60); } /** From 1663d7442e842906704532b2569ca4babb44f6b4 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 16 Aug 2019 17:25:59 +0100 Subject: [PATCH 2/2] TTL could be a DateInterval --- src/Illuminate/Cache/Repository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Cache/Repository.php b/src/Illuminate/Cache/Repository.php index bbf6007154eb..075a54a91742 100755 --- a/src/Illuminate/Cache/Repository.php +++ b/src/Illuminate/Cache/Repository.php @@ -199,7 +199,7 @@ public function put($key, $value, $minutes = null) */ public function set($key, $value, $ttl = null) { - $this->put($key, $value, $ttl === null ? null : $ttl / 60); + $this->put($key, $value, is_int($ttl) ? $ttl / 60 : null); } /** @@ -225,7 +225,7 @@ public function putMany(array $values, $minutes) */ public function setMultiple($values, $ttl = null) { - $this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl === null ? null : $ttl / 60); + $this->putMany(is_array($values) ? $values : iterator_to_array($values), is_int($ttl) ? $ttl / 60 : null); } /**