Completed
Push — master ( c4124b...4cbfbe )
by Luke
01:47
created

GoogleStreetViewObject::setHeading()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
1
<?php
2
3
namespace ZpgRtf\Objects;
4
5
class GoogleStreetViewObject implements \JsonSerializable
6
{
7
    /** @var CoordinatesObject */
8
    private $coordinates;
9
10
    /** @var float */
11
    private $heading;
12
13
    /** @var float */
14
    private $pitch;
15
16
    /**
17
     * @return CoordinatesObject
18
     */
19 2
    public function getCoordinates()
20
    {
21 2
        return $this->coordinates;
22
    }
23
24
    /**
25
     * @param CoordinatesObject $coordinates
26
     *
27
     * @return GoogleStreetViewObject
28
     */
29 1
    public function setCoordinates(CoordinatesObject $coordinates)
30
    {
31 1
        $this->coordinates = $coordinates;
32
33 1
        return $this;
34
    }
35
36
    /**
37
     * @return float
38
     */
39 2
    public function getHeading()
40
    {
41 2
        return $this->heading;
42
    }
43
44
    /**
45
     * @param float $heading
46
     *
47
     * @return GoogleStreetViewObject
48
     */
49 1
    public function setHeading($heading)
50
    {
51 1
        $this->heading = $heading;
52
53 1
        return $this;
54
    }
55
56
    /**
57
     * @return float
58
     */
59 2
    public function getPitch()
60
    {
61 2
        return $this->pitch;
62
    }
63
64
    /**
65
     * @param float $pitch
66
     *
67
     * @return GoogleStreetViewObject
68
     */
69 1
    public function setPitch($pitch)
70
    {
71 1
        $this->pitch = $pitch;
72
73 1
        return $this;
74
    }
75
76
    /** {@inheritDoc} */
77 1
    public function jsonSerialize() {
78
        return [
79 1
            'coordinates' => $this->getCoordinates(),
80 1
            'heading' => $this->getHeading(),
81 1
            'pitch' => $this->getPitch(),
82
        ];
83
    }
84
}
85