Route::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace DH\NavigationBundle\Model\Routing;
4
5
class Route
6
{
7
    /**
8
     * @var Leg[]
9
     */
10
    private $legs;
11
12
    /**
13
     * @var Summary
14
     */
15
    private $summary;
16
17
    public function __construct(array $data)
18
    {
19
        $this->legs = $data['legs'] ?? [];
20
        $this->summary = $data['summary'];
21
    }
22
23
    /**
24
     * @return Leg[]
25
     */
26
    public function getLegs(): array
27
    {
28
        return $this->legs;
29
    }
30
31
    public function getSummary(): Summary
32
    {
33
        return $this->summary;
34
    }
35
}
36