Skip to content

Commit ad4a9d9

Browse files
authored
Merge pull request #101 from Jampire/master
[fix] Returning `null` in `cacheForValue()` doesn't disable caching
2 parents f2915a1 + d669184 commit ad4a9d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/QueryCacheModule.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ public function flushQueryCacheWithTag(string $tag): bool
204204
/**
205205
* Indicate that the query results should be cached.
206206
*
207-
* @param \DateTime|int $time
207+
* @param \DateTime|int|null $time
208208
* @return \Rennokki\QueryCache\Traits\QueryCacheModule
209209
*/
210210
public function cacheFor($time)
211211
{
212212
$this->cacheTime = $time;
213-
$this->avoidCache = false;
213+
$this->avoidCache = $time === null;
214214

215215
return $this;
216216
}

0 commit comments

Comments
 (0)