/** * {@inheritdoc} */ public function map($method, $path, $handler) { $path = $path === '/' ? $this->prefix : $this->prefix . sprintf('/%s', ltrim($path, '/')); $route = $this->collection->map($method, $path, $handler); $route->setParentGroup($this); if ($host = $this->getHost()) { $route->setHost($host); } if ($scheme = $this->getScheme()) { $route->setScheme($scheme); } return $route; }
/** @inheritdoc */ public function dispatch(IServerRequest $request, IResponse $response) { $this->discoverRoutes(); return $this->routes->dispatch($request, $response); }