| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 2 | public function match(RequestInterface $request): RequestMatchResultInterface |
|
| 26 | { |
||
| 27 | 2 | if (strtolower($this->method) !== strtolower($request->getMethod())) { |
|
| 28 | 2 | return RequestMatchResult::failure(); |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | if (!preg_match($this->pathRegex, $request->getUri()->getPath(), $matches)) { |
|
| 32 | 1 | return RequestMatchResult::failure(); |
|
| 33 | } |
||
| 34 | |||
| 35 | $params = array_filter($matches, function($key) { |
||
| 36 | 1 | return is_string($key); |
|
| 37 | 1 | }, ARRAY_FILTER_USE_KEY); |
|
| 38 | |||
| 39 | 1 | return RequestMatchResult::success($params); |
|
| 40 | } |
||
| 41 | } |
||
| 42 |