Total Complexity | 8 |
Total Lines | 88 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Route implements IRoute |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * allowed request method |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $method; |
||
16 | |||
17 | /** |
||
18 | * uri validation regexp |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $expr; |
||
23 | |||
24 | /** |
||
25 | * slug collection |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $slugs; |
||
30 | |||
31 | /** |
||
32 | * instanciate |
||
33 | * |
||
34 | * @param string $routeItem |
||
35 | */ |
||
36 | 6 | public function __construct(string $routeItem) |
|
50 | } |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * return regexp pattern |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 2 | public function getExpr(): string |
|
61 | } |
||
62 | |||
63 | /** |
||
64 | * return required request method |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | 2 | public function getMethod(): string |
|
71 | } |
||
72 | |||
73 | /** |
||
74 | * return slugs |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 1 | public function getSlugs(): array |
|
81 | } |
||
82 | |||
83 | /** |
||
84 | * return parsed slugs as string collection |
||
85 | * |
||
86 | * @param string $rawSlug |
||
87 | * @return array |
||
88 | */ |
||
89 | 1 | protected function parsedSlugs(string $rawSlug): array |
|
97 |