| 1 | <?php |
||
| 10 | class Route |
||
| 11 | { |
||
| 12 | private $name; |
||
| 13 | private $method = ['get']; |
||
| 14 | private $pattern = '/'; |
||
| 15 | private $handler; |
||
| 16 | private $router; |
||
| 17 | |||
| 18 | public function __construct(Router $router, string $name = null) |
||
| 23 | |||
| 24 | public function name(): ?string |
||
| 28 | |||
| 29 | public function method(): array |
||
| 33 | |||
| 34 | public function setMethod($method): Route |
||
| 40 | |||
| 41 | public function pattern(): string |
||
| 45 | |||
| 46 | public function setPattern(string $pattern): Route |
||
| 52 | |||
| 53 | public function handler() |
||
| 57 | |||
| 58 | public function setHandler($handler): Route |
||
| 64 | |||
| 65 | public function end(): Router |
||
| 69 | } |
||
| 70 |