| 1 | <?php |
||
| 9 | class Route implements RouteInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * allowed request method |
||
| 14 | * |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $method; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * uri validation regexp |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $expr; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * slug collection |
||
| 28 | * |
||
| 29 | * @var array |
||
| 30 | */ |
||
| 31 | protected $slugs; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * instanciate |
||
| 35 | * |
||
| 36 | * @param string $routeItem |
||
| 37 | */ |
||
| 38 | 6 | public function __construct(string $routeItem) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * return regexp pattern |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | 2 | public function getExpr(): string |
|
| 64 | |||
| 65 | /** |
||
| 66 | * return required request method |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | 2 | public function getMethod(): string |
|
| 74 | |||
| 75 | /** |
||
| 76 | * return slugs |
||
| 77 | * |
||
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | 1 | public function getSlugs(): array |
|
| 84 | |||
| 85 | /** |
||
| 86 | * return parsed slugs as string collection |
||
| 87 | * |
||
| 88 | * @param string $rawSlug |
||
| 89 | * @return String[] |
||
| 90 | */ |
||
| 91 | 1 | protected function parsedSlugs(string $rawSlug): array |
|
| 98 | } |
||
| 99 |