| Conditions | 6 |
| Paths | 12 |
| Total Lines | 27 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function match(ServerRequest $request): MatchResult |
||
| 39 | { |
||
| 40 | $matchedRules = []; |
||
| 41 | $allowedMethods = []; |
||
| 42 | |||
| 43 | // check for rules that matches the request-target |
||
| 44 | foreach ($this->rules as $rule) { |
||
| 45 | if ($rule->getPattern()->matches($request->getRequestTarget())) { |
||
| 46 | $matchedRules[] = $rule; |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | // else, 404 |
||
| 51 | if (empty($matchedRules)) { |
||
| 52 | return MatchResult::requestTargetNotMatched($request); |
||
| 53 | } |
||
| 54 | |||
| 55 | // make sure rule matches method used and build 'allowed methods' in case of 405 |
||
| 56 | foreach ($matchedRules as $matchedRule) { |
||
| 57 | $allowedMethods[] = $matchedRule->getMethod(); |
||
| 58 | |||
| 59 | if ($matchedRule->matchesMethod($request->getMethod())) { |
||
| 60 | return MatchResult::matched($request, $matchedRule); |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | return MatchResult::methodNotMatched($request, $allowedMethods); |
||
| 65 | } |
||
| 67 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths