Skip to content

Commit 9f2d73e

Browse files
committed
Leverage the cache repository in illuminate for all of its extra functionality
1 parent aa67cba commit 9f2d73e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Drivers/Cache.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
namespace Jaspaul\LaravelRollout\Drivers;
44

5+
use Illuminate\Cache\Repository;
56
use Illuminate\Contracts\Cache\Store;
67
use Opensoft\Rollout\Storage\StorageInterface;
78

89
class Cache implements StorageInterface
910
{
1011
/**
11-
* An instance of a cache store that we can store our keys in.
12+
* An instance of a cache repository that we can store our keys in.
1213
*
13-
* @var \Illuminate\Contracts\Cache\Store;
14+
* @var \Illuminate\Cache\Repository;
1415
*/
1516
protected $store;
1617

@@ -32,7 +33,7 @@ class Cache implements StorageInterface
3233
*/
3334
public function __construct(Store $store, string $prefix = 'rollout')
3435
{
35-
$this->store = $store;
36+
$this->store = new Repository($store);
3637
$this->prefix = $prefix;
3738
}
3839

@@ -50,7 +51,7 @@ public function __construct(Store $store, string $prefix = 'rollout')
5051
public function get($key)
5152
{
5253
$key = sprintf('%s.%s', $this->prefix, $key);
53-
return $this->store->get($key);
54+
return $this->store->get($key, null);
5455
}
5556

5657
/**

0 commit comments

Comments
 (0)