TwitterCoordinates::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
crap 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