protected function mergeRouter(Router $router) { $this->mergeCollections($router->getCollection()); }
/** * * @param PHPLegends\Routes\Router $router * @param PHPLegends\Routes\Route $route * @return mixed * */ protected function callRouteFilters(Router $router, Route $route) { if ($result = $router->getFilters()->processRouteFilters($route)) { return $result; } }
/** * * @{inheritdoc} * */ public function dispatch(Router $router) { $route = $router->findRoute($this->uri, $this->verb); $filterResult = $this->callRouteFilters($router, $route); return $filterResult === null ? $this->callRouteAction($route) : $filterResult; }