Route   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 83
c 0
b 0
f 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 3 1
A getName() 0 3 1
A getSlug() 0 3 1
A __construct() 0 7 1
A getDirections() 0 3 1
A getId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Itmedia\ZippyBusBundle\Schedule;
6
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
80
    {
81
        return $this->version;
82
    }
83
84
    /**
85
     * @return Direction[]
86
     */
87
    public function getDirections(): array
88
    {
89
        return $this->directions;
90
    }
91
}
92