Total Complexity | 6 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Route |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $path; |
||
12 | |||
13 | /** |
||
14 | * @var string|null |
||
15 | */ |
||
16 | protected $hook; |
||
17 | |||
18 | /** |
||
19 | * @var string|null |
||
20 | */ |
||
21 | protected $template; |
||
22 | |||
23 | /** |
||
24 | * Route constructor. |
||
25 | * @param string $path |
||
26 | * @param string|null $hook |
||
27 | * @param string|null $template |
||
28 | */ |
||
29 | public function __construct(string $path, $hook = null, $template = null) |
||
30 | { |
||
31 | $this->hook = $hook; |
||
32 | $this->path = $path; |
||
33 | $this->template = $template; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | public function hasHook() |
||
40 | { |
||
41 | return $this->hook !== null; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getPath() |
||
48 | { |
||
49 | return $this->path; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getHook() |
||
56 | { |
||
57 | return $this->hook; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getTemplate() |
||
66 | } |
||
67 | |||
68 | public function hasTemplate() |
||
69 | { |
||
70 | return $this->template !== null; |
||
74 |