1 | <?php |
||
11 | class DiffCache |
||
12 | { |
||
13 | /** |
||
14 | * @var Cache |
||
15 | */ |
||
16 | protected $cacheProvider; |
||
17 | |||
18 | /** |
||
19 | * DiffCache constructor. |
||
20 | * |
||
21 | * @param Cache $cacheProvider |
||
22 | */ |
||
23 | public function __construct(Cache $cacheProvider) |
||
27 | |||
28 | /** |
||
29 | * @return Cache |
||
30 | */ |
||
31 | public function getCacheProvider() |
||
35 | |||
36 | /** |
||
37 | * @param Cache $cacheProvider |
||
38 | * |
||
39 | * @return DiffCache |
||
40 | */ |
||
41 | public function setCacheProvider($cacheProvider) |
||
47 | |||
48 | /** |
||
49 | * @param string $oldText |
||
50 | * @param string $newText |
||
51 | * |
||
52 | * @return bool |
||
53 | */ |
||
54 | public function contains($oldText, $newText) |
||
58 | |||
59 | /** |
||
60 | * @param string $oldText |
||
61 | * @param string $newText |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function fetch($oldText, $newText) |
||
69 | |||
70 | /** |
||
71 | * @param string $oldText |
||
72 | * @param string $newText |
||
73 | * @param string $data |
||
74 | * @param int $lifeTime |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function save($oldText, $newText, $data, $lifeTime = 0) |
||
82 | |||
83 | /** |
||
84 | * @param string $oldText |
||
85 | * @param string $newText |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function delete($oldText, $newText) |
||
93 | |||
94 | /** |
||
95 | * @return array|null |
||
96 | */ |
||
97 | public function getStats() |
||
101 | |||
102 | /** |
||
103 | * @param string $oldText |
||
104 | * @param string $newText |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | protected function getHashKey($oldText, $newText) |
||
112 | } |
||
113 |