code: public static final function moveFile($file)
      {
          try {
              if($file->is_temp) {
                  rename(
                      $file->temp_destination . '/' . $file->temp_name,
                      $file->original_destination . '/' . $file->temp_name
                  );
  
                  if(!file_exists($file->original_destination . '/' . $file->temp_name)) {
                      throw new CannotSaveFileInHardDriveException();
                  }
  
                  $file->is_temp = false;
                  $file->expire = null;
                  $file->save();
              }
          } catch (\Exception $exception) {
              throw new FileException($exception->getMessage());
          }
      }
docs: Move file from the temporary destination to the original destination
  
  @param \stdClass $file
  @throws File\Exception