| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function getPost($postId, $force = false) |
||
| 38 | { |
||
| 39 | $cacheKey = sprintf('%s.post.%d', self::CACHE_KEY_PREFIX, $postId); |
||
| 40 | |||
| 41 | if (!$force && $post = $this->cache->fetch($cacheKey)) { |
||
| 42 | return $post; |
||
| 43 | } |
||
| 44 | |||
| 45 | $post = $this->client->post($postId); |
||
| 46 | $this->cache->save($cacheKey, $post); |
||
| 47 | |||
| 48 | return $post; |
||
| 49 | } |
||
| 68 |