Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
7 | 1 | public function getWeather($latitude, $longitude, $apikey) |
|
8 | { |
||
9 | 1 | $curl = curl_init(); |
|
10 | 1 | curl_setopt_array($curl, array( |
|
11 | 1 | CURLOPT_RETURNTRANSFER => 1, |
|
12 | 1 | CURLOPT_URL => 'https://api.darksky.net/forecast/' . $apikey . '/' . $latitude . ',' . $longitude . '?exclude=currently,minutely,hourly,alerts,flags' |
|
13 | )); |
||
14 | |||
15 | 1 | $res = curl_exec($curl); |
|
16 | 1 | curl_close($curl); |
|
17 | |||
18 | 1 | return json_decode($res); |
|
19 | } |
||
21 |