original_string: public function export_file(array $subcontext, \stored_file $file) : content_writer {
          if (!$file->is_directory()) {
              $pathitems = array_merge(
                  $subcontext,
                  [$this->get_files_target_path($file->get_component(), $file->get_filearea(), $file->get_itemid())],
                  [$file->get_filepath()]
              );
              $path = $this->get_path($pathitems, $file->get_filename());
              $fullpath = $this->get_full_path($pathitems, $file->get_filename());
              check_dir_exists(dirname($fullpath), true, true);
              $this->files[$path] = $file;
          }
  
          return $this;
      }
code: public function export_file(array $subcontext, \stored_file $file) : content_writer {
          if (!$file->is_directory()) {
              $pathitems = array_merge(
                  $subcontext,
                  [$this->get_files_target_path($file->get_component(), $file->get_filearea(), $file->get_itemid())],
                  [$file->get_filepath()]
              );
              $path = $this->get_path($pathitems, $file->get_filename());
              $fullpath = $this->get_full_path($pathitems, $file->get_filename());
              check_dir_exists(dirname($fullpath), true, true);
              $this->files[$path] = $file;
          }
  
          return $this;
      }
code_tokens: public function export_file ( array $ subcontext , \ stored_file $ file ) : content_writer { if ( ! $ file -> is_directory ( ) ) { $ pathitems = array_merge ( $ subcontext , [ $ this -> get_files_target_path ( $ file -> get_component ( ) , $ file -> get_filearea ( ) , $ file -> get_itemid ( ) ) ] , [ $ file -> get_filepath ( ) ] ) ; $ path = $ this -> get_path ( $ pathitems , $ file -> get_filename ( ) ) ; $ fullpath = $ this -> get_full_path ( $ pathitems , $ file -> get_filename ( ) ) ; check_dir_exists ( dirname ( $ fullpath ) , true , true ) ; $ this -> files [ $ path ] = $ file ; } return $ this ; }
docstring: Export the specified file in the target location.
  
  @param   array           $subcontext The location within the current context that this data belongs.
  @param   \stored_file    $file       The file to be exported.
docstring_tokens: Export the specified file in the target location .