Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 3 | public function getPost(int $postId, bool $force = false): array |
|
23 | { |
||
24 | 3 | $cacheKey = sprintf('%s.post.%d', self::CACHE_KEY_PREFIX, $postId); |
|
25 | |||
26 | 3 | if ($force) { |
|
27 | 3 | $this->cache->delete($cacheKey); |
|
28 | } |
||
29 | |||
30 | 3 | $post = $this->cache->get($cacheKey, function (ItemInterface $item) use ($postId) { |
|
|
|||
31 | 2 | return $this->api->post($postId); |
|
32 | 3 | }); |
|
33 | |||
34 | 3 | return $post; |
|
35 | } |
||
48 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.