1 | <?php |
||
9 | class TwigCacheCollector implements DataCollectorInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $strategyClass; |
||
15 | |||
16 | /** |
||
17 | * Data about fetchBlock requests. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | private $fetchBlock = []; |
||
22 | |||
23 | /** |
||
24 | * Data about generateKey requests. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | private $generateKey = []; |
||
29 | |||
30 | /** |
||
31 | * Cache hits. |
||
32 | * |
||
33 | * @var int |
||
34 | */ |
||
35 | private $hits = 0; |
||
36 | |||
37 | public function collect(Request $request, Response $response, \Exception $exception = null) |
||
41 | |||
42 | /** |
||
43 | * @return string The collector name |
||
44 | */ |
||
45 | public function getName() |
||
49 | |||
50 | /** |
||
51 | * @param string $strategyClass |
||
52 | */ |
||
53 | public function setStrategyClass($strategyClass) |
||
57 | |||
58 | /** |
||
59 | * Store a fetch request. |
||
60 | * |
||
61 | * @param mixed $key |
||
62 | * @param string $output |
||
63 | */ |
||
64 | public function addFetchBlock($key, $output) |
||
72 | |||
73 | /** |
||
74 | * Store a generateKey request. |
||
75 | * |
||
76 | * @param string $annotation |
||
77 | * @param mixed $value |
||
78 | */ |
||
79 | public function addGenerateKey($annotation, $value) |
||
86 | |||
87 | /** |
||
88 | * Get data stored in this profiler. |
||
89 | * |
||
90 | * @return array |
||
91 | */ |
||
92 | public function getData() |
||
101 | |||
102 | /** |
||
103 | * Reset profiler data. |
||
104 | */ |
||
105 | public function reset() |
||
111 | } |
||
112 |