Skip to content

Commit

Permalink
Provide fallbacks for config values
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiandedeyne committed Mar 12, 2024
1 parent 01c25c3 commit 1887ef7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Support/Caching/DataStructureCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class DataStructureCache
public function __construct(
protected array $cacheConfig,
) {
$this->store = cache()->store($this->cacheConfig['store'])?->getStore();
$this->prefix = $this->cacheConfig['prefix'] ? "{$this->cacheConfig['prefix']}." : '';
$this->duration = $this->cacheConfig['duration'];
$this->store = cache()->store(($this->cacheConfig['store'] ?? null))?->getStore();
$this->prefix = ($this->cacheConfig['prefix'] ?? '') ? "{$this->cacheConfig['prefix']}." : '';
$this->duration = $this->cacheConfig['duration'] ?? null;
}

public function getConfig(): ?CachedDataConfig
Expand Down

0 comments on commit 1887ef7

Please sign in to comment.