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