WeatherModel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getWeather() 0 12 1
1
<?php
2
3
namespace Anax\Controller;
4
5
class WeatherModel
6
{
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
    }
20
}
21