Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class RedisManager extends Manager |
||
8 | { |
||
9 | /** |
||
10 | * @var int $ttl time to live. |
||
11 | */ |
||
12 | private $ttl = 0; |
||
13 | |||
14 | /** |
||
15 | * @var string $prefix key prefix. |
||
16 | */ |
||
17 | private $prefix = ''; |
||
18 | |||
19 | /** |
||
20 | * @var \Redis $redis |
||
21 | */ |
||
22 | private $redis; |
||
23 | |||
24 | 2 | public function __construct( |
|
25 | int $capacity, |
||
26 | float $rate, |
||
27 | SerializerInterface $serializer, |
||
28 | \Redis $redis, |
||
29 | int $ttl = 0, |
||
30 | string $prefix = '' |
||
31 | ) { |
||
32 | 2 | parent::__construct($capacity, $rate, $serializer); |
|
33 | 2 | $this->redis = $redis; |
|
34 | 2 | $this->ttl = $ttl; |
|
35 | 2 | $this->prefix = $prefix; |
|
36 | 2 | } |
|
37 | |||
38 | 1 | protected function load(string $name) |
|
41 | } |
||
42 | |||
43 | 1 | protected function save(string $name, $data) |
|
52 | } |
||
53 | 1 | } |
|
55 |