| Total Complexity | 7 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class FallbackMatcher implements UrlMatcherInterface |
||
| 13 | { |
||
| 14 | private UrlMatcherInterface $urlMatcher; |
||
| 15 | private ?Route $currentRoute = null; |
||
| 16 | private ?UriInterface $currentUri = null; |
||
| 17 | private bool $isFallback = false; |
||
| 18 | |||
| 19 | public function __construct(UrlMatcherInterface $urlMatcher) |
||
| 20 | { |
||
| 21 | $this->urlMatcher = $urlMatcher; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function match(ServerRequestInterface $request): MatchingResult |
||
| 25 | { |
||
| 26 | $result = $this->urlMatcher->match($request); |
||
| 27 | if (!$result->isSuccess()) { |
||
| 28 | $this->isFallback = true; |
||
| 29 | // fallback match |
||
| 30 | // $this->currentRoute = ... |
||
| 31 | // $this->currentUrl = ... |
||
| 32 | } |
||
| 33 | return $result; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getCurrentRoute(): ?Route |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getCurrentUri(): ?UriInterface |
||
| 44 | } |
||
| 45 | } |
||
| 46 |