original_string: public function redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false): Response
      {
          if ('' == $route) {
              throw new HttpException($permanent ? 410 : 404);
          }
  
          $attributes = [];
          if (false === $ignoreAttributes || \is_array($ignoreAttributes)) {
              $attributes = $request->attributes->get('_route_params');
              $attributes = $keepQueryParams ? array_merge($request->query->all(), $attributes) : $attributes;
              unset($attributes['route'], $attributes['permanent'], $attributes['ignoreAttributes'], $attributes['keepRequestMethod'], $attributes['keepQueryParams']);
              if ($ignoreAttributes) {
                  $attributes = array_diff_key($attributes, array_flip($ignoreAttributes));
              }
          }
  
          if ($keepRequestMethod) {
              $statusCode = $permanent ? 308 : 307;
          } else {
              $statusCode = $permanent ? 301 : 302;
          }
  
          return new RedirectResponse($this->router->generate($route, $attributes, UrlGeneratorInterface::ABSOLUTE_URL), $statusCode);
      }
code: public function redirectAction(Request $request, string $route, bool $permanent = false, $ignoreAttributes = false, bool $keepRequestMethod = false, bool $keepQueryParams = false): Response
      {
          if ('' == $route) {
              throw new HttpException($permanent ? 410 : 404);
          }
  
          $attributes = [];
          if (false === $ignoreAttributes || \is_array($ignoreAttributes)) {
              $attributes = $request->attributes->get('_route_params');
              $attributes = $keepQueryParams ? array_merge($request->query->all(), $attributes) : $attributes;
              unset($attributes['route'], $attributes['permanent'], $attributes['ignoreAttributes'], $attributes['keepRequestMethod'], $attributes['keepQueryParams']);
              if ($ignoreAttributes) {
                  $attributes = array_diff_key($attributes, array_flip($ignoreAttributes));
              }
          }
  
          if ($keepRequestMethod) {
              $statusCode = $permanent ? 308 : 307;
          } else {
              $statusCode = $permanent ? 301 : 302;
          }
  
          return new RedirectResponse($this->router->generate($route, $attributes, UrlGeneratorInterface::ABSOLUTE_URL), $statusCode);
      }
code_tokens: public function redirectAction ( Request $ request , string $ route , bool $ permanent = false , $ ignoreAttributes = false , bool $ keepRequestMethod = false , bool $ keepQueryParams = false ) : Response { if ( '' == $ route ) { throw new HttpException ( $ permanent ? 410 : 404 ) ; } $ attributes = [ ] ; if ( false === $ ignoreAttributes || \ is_array ( $ ignoreAttributes ) ) { $ attributes = $ request -> attributes -> get ( '_route_params' ) ; $ attributes = $ keepQueryParams ? array_merge ( $ request -> query -> all ( ) , $ attributes ) : $ attributes ; unset ( $ attributes [ 'route' ] , $ attributes [ 'permanent' ] , $ attributes [ 'ignoreAttributes' ] , $ attributes [ 'keepRequestMethod' ] , $ attributes [ 'keepQueryParams' ] ) ; if ( $ ignoreAttributes ) { $ attributes = array_diff_key ( $ attributes , array_flip ( $ ignoreAttributes ) ) ; } } if ( $ keepRequestMethod ) { $ statusCode = $ permanent ? 308 : 307 ; } else { $ statusCode = $ permanent ? 301 : 302 ; } return new RedirectResponse ( $ this -> router -> generate ( $ route , $ attributes , UrlGeneratorInterface :: ABSOLUTE_URL ) , $ statusCode ) ; }
docstring: Redirects to another route with the given name.
  
  The response status code is 302 if the permanent parameter is false (default),
  and 301 if the redirection is permanent.
  
  In case the route name is empty, the status code will be 404 when permanent is false
  and 410 otherwise.
  
  @param Request    $request           The request instance
  @param string     $route             The route name to redirect to
  @param bool       $permanent         Whether the redirection is permanent
  @param bool|array $ignoreAttributes  Whether to ignore attributes or an array of attributes to ignore
  @param bool       $keepRequestMethod Whether redirect action should keep HTTP request method
  
  @throws HttpException In case the route name is empty
docstring_tokens: Redirects to another route with the given name .