original_string: public function generateUniqueRoute(RouteInterface $route, $withSlash = false)
      {
          $originalRoutePattern = $this->generateRouteFromText($route->getRoutePattern(), $withSlash);
  
          if ($originalRoutePattern) {
              $key = 0;
              $routePattern = $this->normalizeRoute($originalRoutePattern);
  
              while ($this->hasRoute($routePattern, $route->getName())) {
                  $key++;
                  $routePattern = $originalRoutePattern . '-' . $key;
              }
  
              $route->setRoutePattern($routePattern);
  
              return $route;
          }
  
          return null;
      }
code: public function generateUniqueRoute(RouteInterface $route, $withSlash = false)
      {
          $originalRoutePattern = $this->generateRouteFromText($route->getRoutePattern(), $withSlash);
  
          if ($originalRoutePattern) {
              $key = 0;
              $routePattern = $this->normalizeRoute($originalRoutePattern);
  
              while ($this->hasRoute($routePattern, $route->getName())) {
                  $key++;
                  $routePattern = $originalRoutePattern . '-' . $key;
              }
  
              $route->setRoutePattern($routePattern);
  
              return $route;
          }
  
          return null;
      }
code_tokens: public function generateUniqueRoute ( RouteInterface $ route , $ withSlash = false ) { $ originalRoutePattern = $ this -> generateRouteFromText ( $ route -> getRoutePattern ( ) , $ withSlash ) ; if ( $ originalRoutePattern ) { $ key = 0 ; $ routePattern = $ this -> normalizeRoute ( $ originalRoutePattern ) ; while ( $ this -> hasRoute ( $ routePattern , $ route -> getName ( ) ) ) { $ key ++ ; $ routePattern = $ originalRoutePattern . '-' . $ key ; } $ route -> setRoutePattern ( $ routePattern ) ; return $ route ; } return null ; }
docstring: Generate unique route.
  
  @param RouteInterface $route
  @param bool $withSlash
  
  @return null|RouteInterface
docstring_tokens: Generate unique route .