Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | final class SetCacheException extends CacheException |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private $key; |
||
12 | private $value; |
||
13 | |||
14 | /** |
||
15 | * @var CacheInterface |
||
16 | */ |
||
17 | private $cache; |
||
18 | |||
19 | 2 | public function __construct( |
|
20 | string $key, |
||
21 | $value, |
||
22 | CacheInterface $cache, |
||
23 | $message = 'Could not store the value in the cache', |
||
24 | $code = 0, |
||
25 | \Throwable $previous = null |
||
26 | ) { |
||
27 | 2 | $this->key = $key; |
|
28 | 2 | $this->value = $value; |
|
29 | 2 | $this->cache = $cache; |
|
30 | 2 | parent::__construct($message, $code, $previous); |
|
31 | } |
||
32 | |||
33 | 1 | public function getKey(): string |
|
34 | { |
||
35 | 1 | return $this->key; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 1 | public function getValue() |
|
42 | { |
||
43 | 1 | return $this->value; |
|
44 | } |
||
45 | |||
46 | 1 | public function getCache(): CacheInterface |
|
49 | } |
||
50 | } |
||
51 |