| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class PathResolver |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param string $path |
||
| 11 | * @param ServerRequestInterface $request |
||
| 12 | * |
||
| 13 | * @return bool |
||
| 14 | */ |
||
| 15 | public function isMatch(string $path, ServerRequestInterface $request): bool |
||
| 16 | { |
||
| 17 | $regexp = $this->makeRegExp($path); |
||
| 18 | return preg_match('~^'.$regexp.'$~Uiu', $request->getUri()->getPath(), $values) === 1; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function makeRegExp(string $path): string |
||
| 36 | } |
||
| 37 | } |
||
| 38 |