| Total Complexity | 7 |
| Total Lines | 100 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 95 | } |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Get the value of flags. |
||
| 99 | * |
||
| 100 | * @return array |
||
| 101 | */ |
||
| 102 | public function getFlags(): array |
||
| 105 | } |
||
| 106 | } |