Skip to content

Commit

Permalink
Set cache as false as default
Browse files Browse the repository at this point in the history
  • Loading branch information
eusonlito authored Jan 31, 2022
1 parent fe20f4e commit c50b2eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CacheBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CacheBuilder extends Builder
/**
* @var int|\DateTimeInterface|\DateInterval|null
*/
protected int|DateTimeInterface|DateInterval|null $cacheTTL;
protected int|DateTimeInterface|DateInterval|null $cacheTTL = 0;

/**
* @var ?string
Expand All @@ -40,7 +40,7 @@ protected function runSelect()
*/
public function cache(int|DateTimeInterface|DateInterval|null $ttl = null, ?string $key = null): self
{
$this->cacheTTL = $ttl;
$this->cacheTTL = $ttl ?? $this->cacheConfig('ttl');
$this->cacheKey = $key;

return $this;
Expand Down Expand Up @@ -115,7 +115,7 @@ protected function cacheKey(): string
*/
protected function cacheTTL(): int|DateTimeInterface|DateInterval|null
{
return $this->cacheTTL ?? $this->cacheConfig('ttl');
return $this->cacheTTL;
}

/**
Expand Down

0 comments on commit c50b2eb

Please sign in to comment.