1 | <?php |
||
20 | class Cache extends AbstractMiddleware |
||
21 | { |
||
22 | use CacheTrait; |
||
23 | use LoggerTrait; |
||
24 | |||
25 | const DEFAULT_TTL = 60; |
||
26 | const PREFIX = 'cache:'; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $cacheKey; |
||
32 | |||
33 | /** |
||
34 | * @var boolean |
||
35 | */ |
||
36 | private $enabled; |
||
37 | |||
38 | /** |
||
39 | * @Inject("%cache.enabled%") |
||
40 | * @param bool $cacheEnabled |
||
41 | 3 | */ |
|
42 | public function __construct($cacheEnabled) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | 3 | */ |
|
50 | public function processRequest(Request $request, Route $route) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | 2 | */ |
|
70 | public function processResponse(Request $request, Response $response) |
||
87 | |||
88 | /** |
||
89 | * @param Request $request |
||
90 | * @return string |
||
91 | 2 | */ |
|
92 | private function generateCacheKey(Request $request) |
||
96 | |||
97 | /** |
||
98 | * @param CacheProvider$cache |
||
99 | * @return Response |
||
100 | 1 | */ |
|
101 | private function handleCached(CacheProvider $cache) |
||
117 | |||
118 | /** |
||
119 | * @return int |
||
120 | */ |
||
121 | private function getTTL() |
||
125 | } |
||
126 |
This check looks
TODO
comments that have been left in the code.``TODO``s show that something is left unfinished and should be attended to.