Conditions | 2 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.3149 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 1 | public function getLatestVersionNumber(): string |
|
30 | { |
||
31 | return $this->cache->remember(self::CACHE_KEY, 1 * 24 * 60, function (): string { |
||
32 | try { |
||
33 | 1 | return json_decode( |
|
34 | 1 | $this->client->get('https://api.github.com/repos/phanan/koel/tags')->getBody() |
|
35 | 1 | )[0]->name; |
|
36 | } catch (Exception $e) { |
||
37 | $this->logger->error($e); |
||
38 | |||
39 | return Application::KOEL_VERSION; |
||
40 | } |
||
44 |