public function build(array $config)
    {
        $router = new Router();
        foreach ($config as $name => $route) {
            if ($route instanceof RouteInterface) {
                $router->register($name, $route);
                continue;
            }

            $route = $this->applyDefaults($route);

            $router->register(
                $name,
                $this->createDefinition($route)
            );
        }

        return $router;
    }
public function build(array $config)
    {
        $router = new Router();
        foreach ($config as $name => $route) {
            if ($route instanceof RouteInterface) {
                $router->register($name, $route);
                continue;
            }

            $route = $this->applyDefaults($route);

            $router->register(
                $name,
                $this->createDefinition($route)
            );
        }

        return $router;
    }
public function build ( array $ config ) { $ router = new Router ( ) ; foreach ( $ config as $ name => $ route ) { if ( $ route instanceof RouteInterface ) { $ router -> register ( $ name , $ route ) ; continue ; } $ route = $ this -> applyDefaults ( $ route ) ; $ router -> register ( $ name , $ this -> createDefinition ( $ route ) ) ; } return $ router ; }
Builds router and routes

@param array $config

@return Router
Builds router and routes