Total Complexity | 6 |
Total Lines | 83 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Route implements SlugAware |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var int |
||
12 | */ |
||
13 | private $id; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $slug; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $name; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | private $version; |
||
29 | |||
30 | /** |
||
31 | * @var Direction[] |
||
32 | */ |
||
33 | private $directions = []; |
||
34 | |||
35 | /** |
||
36 | * Route constructor. |
||
37 | * @param int $id |
||
38 | * @param string $slug |
||
39 | * @param string $name |
||
40 | * @param int $version |
||
41 | * @param Direction[] $directions |
||
42 | */ |
||
43 | public function __construct(int $id, string $slug, string $name, int $version, array $directions) |
||
44 | { |
||
45 | $this->id = $id; |
||
46 | $this->slug = $slug; |
||
47 | $this->name = $name; |
||
48 | $this->version = $version; |
||
49 | $this->directions = $directions; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return int |
||
54 | */ |
||
55 | public function getId(): int |
||
56 | { |
||
57 | return $this->id; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getSlug(): string |
||
64 | { |
||
65 | return $this->slug; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getName(): string |
||
72 | { |
||
73 | return $this->name; |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return int |
||
78 | */ |
||
79 | public function getVersion(): int |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @return Direction[] |
||
86 | */ |
||
87 | public function getDirections(): array |
||
90 | } |
||
91 | } |
||
92 |