Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | protected function getRegularExpression(): string |
||
21 | { |
||
22 | $route = new Route($this->pattern); |
||
23 | $route->setRequirements($this->wheres); |
||
24 | |||
25 | $regex = $route->compile()->getRegex(); |
||
26 | |||
27 | $regex = preg_replace('/^(#|{)\^\/(.*)/', '$1^$2', $regex); |
||
28 | |||
29 | $regex = str_replace('>[^/]+)', '>.+)', $regex); |
||
30 | |||
31 | $regex = str_replace('$#sD', '$#sDi', $regex); |
||
32 | $regex = str_replace('$}sD', '$}sDi', $regex); |
||
33 | |||
34 | return $regex; |
||
35 | } |
||
51 |