Ipstack   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIpInfo() 0 7 1
1
<?php
2
3
namespace Anax\Ipstack;
4
5
/**
6
 * A model class retrievieng data from an ipstack server.
7
 *
8
 * @SuppressWarnings(PHPMD.ShortVariable)
9
 */
10
class Ipstack
11
{
12 2
    public function getIpInfo(string $ip, $key) : array
13
    {
14
         
15 2
        $url = "http://api.ipstack.com/$ip?access_key=" . $key;
16 2
        $res = file_get_contents($url);
17 2
        $info = json_decode($res, true);
18 2
        return $info;
19
    }
20
}
21