Phone   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
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 20
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 6 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
 * 手机号码归属地查询.
16
 *
17
 * @see http://apistore.baidu.com/apiworks/servicedetail/117.html
18
 */
19
class Phone extends Api
20
{
21
    /**
22
     * @var string API address
23
     */
24
    private $address = 'http://apis.baidu.com/apistore/mobilephoneservice/mobilephone?';
25
    /**
26
     * 获取手机信息.
27
     *
28
     * @param string $tel
29
     *
30
     * @return array
31
     */
32 2
    public function get($tel)
33
    {
34 2
        $query_str = http_build_query(['tel' => $tel]);
35
36 2
        return $this->fetch($this->address . $query_str);
37
    }
38
}
39