| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function latestRelease() |
||
| 10 | { |
||
| 11 | $ch = curl_init(); |
||
| 12 | $timeout = 5; |
||
| 13 | curl_setopt($ch, CURLOPT_URL, self::URL); |
||
| 14 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
||
| 15 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
||
| 16 | curl_setopt($ch,CURLOPT_USERAGENT,'Awesome-Octocat-App'); |
||
| 17 | $data = curl_exec($ch); |
||
| 18 | curl_close($ch); |
||
| 19 | |||
| 20 | $latestRelease = json_decode($data, true); |
||
| 21 | |||
| 22 | return $latestRelease; |
||
| 23 | } |
||
| 24 | |||
| 40 | } |