| Total Complexity | 10 |
| Total Lines | 88 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Route |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $method; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $name; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var callable|string |
||
| 22 | */ |
||
| 23 | private $action; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $path; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | private $parameters = []; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var array |
||
| 37 | */ |
||
| 38 | private $wheres = []; |
||
| 39 | |||
| 40 | public function __construct(string $method, string $path, string $name, $action) |
||
| 41 | { |
||
| 42 | $this->name = $name; |
||
| 43 | $this->action = $action; |
||
| 44 | $this->path = $path; |
||
| 45 | $this->method = $method; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function getPath(): string |
||
| 49 | { |
||
| 50 | return $this->path; |
||
| 51 | } |
||
| 52 | |||
| 53 | public function getName(): string |
||
| 54 | { |
||
| 55 | return $this->name; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return callable|string |
||
| 60 | */ |
||
| 61 | public function getAction() |
||
| 62 | { |
||
| 63 | return $this->action; |
||
| 64 | } |
||
| 65 | |||
| 66 | public function getParameters(): array |
||
| 67 | { |
||
| 68 | return $this->parameters; |
||
| 69 | } |
||
| 70 | |||
| 71 | public function setParameters(array $parameters): void |
||
| 72 | { |
||
| 73 | $this->parameters = array_merge($this->parameters, $parameters); |
||
| 74 | } |
||
| 75 | |||
| 76 | public function where(array $expressions) |
||
| 77 | { |
||
| 78 | $this->wheres = array_merge($this->wheres, $expressions); |
||
| 79 | |||
| 80 | return $this; |
||
| 81 | } |
||
| 82 | |||
| 83 | public function getWhere(): array |
||
| 86 | } |
||
| 87 | |||
| 88 | public function getMethod(): string |
||
| 89 | { |
||
| 91 | } |
||
| 92 | |||
| 93 | public function setMethods(string $method): void |
||
| 96 | } |
||
| 97 | } |
||
| 98 |