1 | <?php |
||
6 | abstract class ItemDecorator implements CacheItemInterface |
||
7 | { |
||
8 | /** @var CacheItemInterface */ |
||
9 | private $decorated; |
||
10 | /** @var mixed */ |
||
11 | private $decrypted; |
||
12 | /** @var string */ |
||
13 | private $cipher; |
||
14 | |||
15 | 333 | public function __construct(CacheItemInterface $decorated, $cipher) |
|
20 | |||
21 | 228 | public function getKey() |
|
25 | |||
26 | 174 | public function get() |
|
34 | |||
35 | 294 | public function getDecorated() |
|
39 | |||
40 | 222 | public function set($value) |
|
47 | |||
48 | 144 | public function isHit() |
|
53 | |||
54 | 6 | public function expiresAt($expiresAt) |
|
60 | |||
61 | 12 | public function expiresAfter($expiresAfter) |
|
67 | |||
68 | abstract protected function encrypt($data); |
||
69 | |||
70 | abstract protected function decrypt(EncryptedValue $data); |
||
71 | |||
72 | abstract protected function isDecryptable(); |
||
73 | |||
74 | 222 | protected function getCipherMethod() |
|
78 | |||
79 | 222 | protected function generateIv() |
|
85 | |||
86 | 222 | protected function encryptString($string, $key, $iv) |
|
90 | |||
91 | 132 | protected function decryptString($string, $method, $key, $iv) |
|
95 | } |
||
96 |