public function createService(string $key, ServiceLocatorInterface $serviceLocator, array $extra = null): object
    {
        $config = $serviceLocator->getConfig();
        $config = $config[RouterInterface::class] ?? [];

        $router = new Router();
        foreach ($config['routes'] ?? [] as $name => $config) {
            $router->addRoute(
                $this->createRoute($serviceLocator, $config),
                $name
            );
        }

        return $router;
    }