Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | private function getCachedResponse(string $key) |
||
41 | { |
||
42 | $cacheItem = $this->cache->getItem($key); |
||
43 | |||
44 | if ($cacheItem->isHit()) { |
||
45 | return $cacheItem->get(); |
||
46 | } |
||
47 | |||
48 | $result = $this->fetchData($key); |
||
49 | |||
50 | $cacheItem->set($result); |
||
51 | $cacheItem->expiresAfter($this->cacheTTL); |
||
52 | $this->cache->save($cacheItem); |
||
53 | |||
62 | } |