Rewrite UrlGenerator::doGenerate to be compatible with Symfony 2.3.9