/** * Builds a Route instance based on the given route config. * * @param ConfigObject $routeConfig A config object containing route parameters. * * @return Route */ public function processRoute(ConfigObject $routeConfig) { // base route $callback = $this->isString($routeConfig->Callback) ? $routeConfig->Callback : $routeConfig->Callback->toArray(); $route = new Route($routeConfig->Path, $callback); // route options if (($options = $routeConfig->get('Options', false)) !== false) { $route->setOptions($options->toArray()); } // host if (($host = $routeConfig->get('Host', false)) !== false) { $route->setHost($host); } // schemes if (($schemes = $routeConfig->get('Schemes', false)) !== false) { $route->setSchemes($schemes); } // methods if (($methods = $routeConfig->get('Methods', false)) !== false) { $route->setMethods($methods->toArray()); } // tags if (($tags = $routeConfig->get('Tags', false)) !== false) { $route->setTags($tags->toArray()); } return $route; }