/** * Attempts to find a matching route for input $uri and $method * @param string $uri * @param string $method * @return IRoute */ public function findMatch(\string $uri, \string $method) { foreach ($this->router->getRouteCollection() as $route) { if ($this->isRouteAMatch($route, $uri, $method)) { $route->setUserVariables($this->routeVariablesBuffer); return $route; } } return null; }