Passed
Push — master ( d31a50...87284d )
by Damien
02:11
created

Summary::getDistance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace DH\NavigationBundle\Model\Routing;
4
5
class Summary
6
{
7
    /**
8
     * @var int
9
     */
10
    private $distance;
11
12
    /**
13
     * @var int
14
     */
15
    private $trafficTime;
16
17
    /**
18
     * @var int
19
     */
20
    private $baseTime;
21
22
    /**
23
     * @var int
24
     */
25
    private $travelTime;
26
27
    /**
28
     * @var string
29
     */
30
    private $text;
31
32
    /**
33
     * @var array
34
     */
35
    private $flags;
36
37
    public function __construct(array $data)
38
    {
39
        $this->distance = $data['distance'] ?? null;
40
        $this->trafficTime = $data['trafficTime'] ?? null;
41
        $this->baseTime = $data['baseTime'] ?? null;
42
        $this->travelTime = $data['travelTime'] ?? null;
43
        $this->text = $data['text'] ?? null;
44
        $this->flags = $data['flags'] ?? [];
45
    }
46
47
    /**
48
     * Get the value of distance.
49
     *
50
     * @return int
51
     */
52
    public function getDistance(): int
53
    {
54
        return $this->distance;
55
    }
56
57
    /**
58
     * Get the value of trafficTime.
59
     *
60
     * @return int
61
     */
62
    public function getTrafficTime(): int
63
    {
64
        return $this->trafficTime;
65
    }
66
67
    /**
68
     * Get the value of baseTime.
69
     *
70
     * @return int
71
     */
72
    public function getBaseTime(): int
73
    {
74
        return $this->baseTime;
75
    }
76
77
    /**
78
     * Get the value of travelTime.
79
     *
80
     * @return int
81
     */
82
    public function getTravelTime(): int
83
    {
84
        return $this->travelTime;
85
    }
86
87
    /**
88
     * Get the value of text.
89
     *
90
     * @return string
91
     */
92
    public function getText(): string
93
    {
94
        return $this->text;
95
    }
96
97
    /**
98
     * Get the value of flags.
99
     *
100
     * @return array
101
     */
102
    public function getFlags(): array
103
    {
104
        return $this->flags;
105
    }
106
}