original_string: public function removeTrailingSlash()
  	{
  		$pathInfo = $this->app['request']->getPathInfo();
  		$requestUri = $this->app['request']->getRequestUri();
  
  		$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
  
  		return $this->redirect($url, Response::HTTP_MOVED_PERMANENTLY);
  	}
code: public function removeTrailingSlash()
  	{
  		$pathInfo = $this->app['request']->getPathInfo();
  		$requestUri = $this->app['request']->getRequestUri();
  
  		$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
  
  		return $this->redirect($url, Response::HTTP_MOVED_PERMANENTLY);
  	}
code_tokens: public function removeTrailingSlash ( ) { $ pathInfo = $ this -> app [ 'request' ] -> getPathInfo ( ) ; $ requestUri = $ this -> app [ 'request' ] -> getRequestUri ( ) ; $ url = str_replace ( $ pathInfo , rtrim ( $ pathInfo , ' /' ) , $ requestUri ) ; return $ this -> redirect ( $ url , Response :: HTTP_MOVED_PERMANENTLY ) ; }
docstring: Remove trailing slash and redirect permanent
  
  @return \Symfony\Component\HttpFoundation\RedirectResponse
docstring_tokens: Remove trailing slash and redirect permanent