Beispiel #1
0
 /**
  * routeFromArray(): defined by SimpleRouteStack.
  *
  * @param array|\Traversable $specs
  *
  * @throws \RuntimeException
  * @return RouteInterface
  */
 protected function routeFromArray($specs)
 {
     $route = parent::routeFromArray($specs);
     if (!$route instanceof RouteInterface) {
         throw new \RuntimeException('Given route does not implement HTTP route interface');
     }
     if (isset($specs['child_routes'])) {
         $options = array('route' => $route, 'may_terminate' => isset($specs['may_terminate']) && $specs['may_terminate'], 'child_routes' => $specs['child_routes'], 'route_plugins' => $this->routePluginManager);
         $priority = isset($route->priority) ? $route->priority : null;
         $route = $this->routePluginManager->get('part', $options);
         $route->priority = $priority;
     }
     return $route;
 }