TwitterCoordinates   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 70
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getLatitude() 0 4 1
A getLongitude() 0 4 1
A getType() 0 4 1
A create() 0 10 1
1
<?php
2
3
namespace Twitter\Object;
4
5
use Twitter\TwitterSerializable;
6
7
class TwitterCoordinates implements TwitterSerializable
8
{
9
    const TYPE_POINT = 'point';
10
11
    /**
12
     * @var string
13
     */
14
    private $type;
15
16
    /**
17
     * @var float
18
     */
19
    private $longitude;
20
21
    /**
22
     * @var float
23
     */
24
    private $latitude;
25
26
    /**
27
     * Constructor.
28
     */
29 18
    public function __construct()
30
    {
31 18
    }
32
33
    /**
34
     * @return float
35
     */
36 9
    public function getLatitude()
37
    {
38 9
        return $this->latitude;
39
    }
40
41
    /**
42
     * @return float
43
     */
44 9
    public function getLongitude()
45
    {
46 9
        return $this->longitude;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 9
    public function getType()
53
    {
54 9
        return $this->type;
55
    }
56
57
    /**
58
     * Static constructor.
59
     *
60
     * @param float  $latitude
61
     * @param float  $longitude
62
     * @param string $type
63
     *
64
     * @return TwitterCoordinates
65
     */
66 18
    public static function create($longitude, $latitude, $type)
67
    {
68 18
        $obj = new self();
69
70 18
        $obj->latitude = $latitude;
71 18
        $obj->longitude = $longitude;
72 18
        $obj->type = $type;
73
74 18
        return $obj;
75
    }
76
}
77