protected function isRegistrationEnabled()
    {
        $router = $this->container->get('router');

        if (get_class($router) == 'JMS\I18nRoutingBundle\Router\I18nRouter') {
            $routes = $router->getOriginalRouteCollection();
        } else {
            $routes = $router->getRouteCollection();
        }

        return (null !== $routes->get('fos_user_registration_register'));
    }