| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Router |
||
| 15 | { |
||
| 16 | protected RouteCollection $collection; |
||
| 17 | protected Matcher $matcher; |
||
| 18 | |||
| 19 | public function __construct() |
||
| 20 | { |
||
| 21 | $this->collection = new RouteCollection(); |
||
| 22 | $this->matcher = new Matcher($this->collection); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function match(string $route_path): Route |
||
| 26 | { |
||
| 27 | return $this->matcher->match($route_path); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function addRoute(Route $route): self |
||
| 35 | } |
||
| 36 | } |
||
| 37 |