| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 8 | protected function queryForge($query) |
|
| 20 | { |
||
| 21 | 8 | $url = "https://forge.typo3.org/{$query}.json"; |
|
| 22 | |||
| 23 | 8 | $ch = curl_init(); |
|
| 24 | 8 | $timeout = 5; |
|
| 25 | 8 | curl_setopt($ch, CURLOPT_URL, $url); |
|
| 26 | 8 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 27 | 8 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
|
| 28 | 8 | $data = curl_exec($ch); |
|
| 29 | |||
| 30 | 8 | $result = false; |
|
| 31 | 8 | if (!curl_errno($ch)) { |
|
| 32 | 8 | curl_close($ch); |
|
| 33 | 8 | $result = json_decode($data); |
|
| 34 | } |
||
| 35 | |||
| 36 | 8 | return $result; |
|
| 37 | } |
||
| 38 | } |
||
| 39 |