original_string: public function renameFile(FileInfo $fileInfo, $new_file_name)
      {
          try {
              $this->validateFile($fileInfo, $new_file_name);
              $fm = new Filesystem();
              $old_file = $fileInfo->getFilepath(true);
              $new_file = $new_file_name;
              $fm->rename($old_file, $new_file);
          } catch (\Exception $e) {
              $this->getFileManager()->throwError("Cannot rename file or directory", 500, $e);
          }
      }
code: public function renameFile(FileInfo $fileInfo, $new_file_name)
      {
          try {
              $this->validateFile($fileInfo, $new_file_name);
              $fm = new Filesystem();
              $old_file = $fileInfo->getFilepath(true);
              $new_file = $new_file_name;
              $fm->rename($old_file, $new_file);
          } catch (\Exception $e) {
              $this->getFileManager()->throwError("Cannot rename file or directory", 500, $e);
          }
      }
code_tokens: public function renameFile ( FileInfo $ fileInfo , $ new_file_name ) { try { $ this -> validateFile ( $ fileInfo , $ new_file_name ) ; $ fm = new Filesystem ( ) ; $ old_file = $ fileInfo -> getFilepath ( true ) ; $ new_file = $ new_file_name ; $ fm -> rename ( $ old_file , $ new_file ) ; } catch ( \ Exception $ e ) { $ this -> getFileManager ( ) -> throwError ( "Cannot rename file or directory" , 500 , $ e ) ; } }
docstring: Renames the file
  
  @param FileInfo $fileInfo
  @param string   $new_file_name
docstring_tokens: Renames the file