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