BaiduGeolocation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getGeolocation() 0 6 1
1
<?php
2
namespace graychen\geolocation;
3
4
use graychen\contracts\GeolocationInterface;
5
use graychen\contracts\Geolocation;
6
7
class BaiduGeolocation extends Geolocation implements GeolocationInterface
8
{
9 1
    public function getGeolocation()
10
    {
11 1
        $url="http://api.map.baidu.com/geocoder/v2/?location=".$this->latitude.",".$this->longitude."&output=json&pois=1&ak=".$this->ak;
12 1
        $file_contents=file_get_contents($url);
13 1
        $json_content=json_decode($file_contents, true);
14 1
        return $json_content;
15
    }
16
}
17