Skip to content

Commit 1663d74

Browse files
TTL could be a DateInterval
1 parent c9d7a69 commit 1663d74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Cache/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function put($key, $value, $minutes = null)
199199
*/
200200
public function set($key, $value, $ttl = null)
201201
{
202-
$this->put($key, $value, $ttl === null ? null : $ttl / 60);
202+
$this->put($key, $value, is_int($ttl) ? $ttl / 60 : null);
203203
}
204204

205205
/**
@@ -225,7 +225,7 @@ public function putMany(array $values, $minutes)
225225
*/
226226
public function setMultiple($values, $ttl = null)
227227
{
228-
$this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl === null ? null : $ttl / 60);
228+
$this->putMany(is_array($values) ? $values : iterator_to_array($values), is_int($ttl) ? $ttl / 60 : null);
229229
}
230230

231231
/**

0 commit comments

Comments
 (0)