| 1 | <?php |
||
| 15 | class Route |
||
| 16 | { |
||
| 17 | public const METHOD_GET = 'GET'; |
||
| 18 | public const METHOD_POST = 'POST'; |
||
| 19 | public const METHOD_PUT = 'PUT'; |
||
| 20 | public const METHOD_DELETE = 'DELETE'; |
||
| 21 | |||
| 22 | private $allowedMethods = [ |
||
| 23 | self::METHOD_GET, |
||
| 24 | self::METHOD_POST, |
||
| 25 | self::METHOD_PUT, |
||
| 26 | self::METHOD_DELETE |
||
| 27 | ]; |
||
| 28 | |||
| 29 | protected $path; |
||
| 30 | protected $method; |
||
| 31 | |||
| 32 | 10 | public function __construct(string $path, string $method) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 5 | public function getPath(): string |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | 5 | public function getMethod(): string |
|
| 56 | } |
||
| 57 |