original_string: public function removeTrailingSlashAction(Request $request)
      {
          $pathInfo   = $request->getPathInfo();
          $requestUri = $request->getRequestUri();
          
          $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
          
          return $this->redirect($url, 301);
      }
code: public function removeTrailingSlashAction(Request $request)
      {
          $pathInfo   = $request->getPathInfo();
          $requestUri = $request->getRequestUri();
          
          $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
          
          return $this->redirect($url, 301);
      }
code_tokens: public function removeTrailingSlashAction ( Request $ request ) { $ pathInfo = $ request -> getPathInfo ( ) ; $ requestUri = $ request -> getRequestUri ( ) ; $ url = str_replace ( $ pathInfo , rtrim ( $ pathInfo , ' /' ) , $ requestUri ) ; return $ this -> redirect ( $ url , 301 ) ; }
docstring: Action used to remove trailing slash in url
  
  @param Request $request
  
  @return \Symfony\Component\HttpFoundation\RedirectResponse
docstring_tokens: Action used to remove trailing slash in url