Ip   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 21
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the light/apistore.
5
 *
6
 * (c) lichunqiang <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace light\apistore\apis;
13
14
/**
15
 * IP地址查询.
16
 *
17
 * @see http://apistore.baidu.com/apiworks/servicedetail/114.html
18
 */
19
class Ip extends Api
20
{
21
    /**
22
     * 接口地址
23
     *
24
     * @var string
25
     */
26
    private $address = 'http://apis.baidu.com/apistore/iplookupservice/iplookup?ip=';
27
28
    /**
29
     * Reqeust the api interface, and get the result.
30
     *
31
     * @param string $ip_address ip string
32
     *
33
     * @return mixed
34
     */
35 1
    public function get($ip_address)
36
    {
37 1
        return $this->fetch($this->address . $ip_address);
38
    }
39
}
40