original_string: private function normalizeDir($dir)
      {
          $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
  
          if (preg_match('#^s?ftp://#', $dir)) {
              $dir .= '/';
          }
  
          return $dir;
      }
code: private function normalizeDir($dir)
      {
          $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
  
          if (preg_match('#^s?ftp://#', $dir)) {
              $dir .= '/';
          }
  
          return $dir;
      }
code_tokens: private function normalizeDir ( $ dir ) { $ dir = rtrim ( $ dir , '/' . \ DIRECTORY_SEPARATOR ) ; if ( preg_match ( '#^s?ftp://#' , $ dir ) ) { $ dir .= '/' ; } return $ dir ; }
docstring: Normalizes given directory names by removing trailing slashes.
  
  Excluding: (s)ftp:// wrapper
  
  @param string $dir
  
  @return string
docstring_tokens: Normalizes given directory names by removing trailing slashes .