Set the destination file to write the result in

@param string $destination_file The file path or name to create and write in
@return self
@throws \InvalidArgumentException if the file name is not a string (and if $silent==false)
18964
public function setDestinationFile($destination_file)
    {
        if (is_string($destination_file)) {
            $this->destination_file = $destination_file;
        } else {
            if (false===$this->silent) {
                throw new \InvalidArgumentException(
                    sprintf('[Compressor] Destination file name must be a string (got "%s")!', gettype($destination_file))
                );
            }
        }
        return $this;
    }
806593
public function setDestination($destination)
    {
        if ($destination instanceof Closure) {
            $this->callbacks['destination'] = $destination;
        } else {
            $this->options = self::parsePath($destination) + $this->options;
        }

        return $this;
    }
1321213
public function sendFile($file) {
		if ($this->sent) {
			return $this;
		}

		$this->setMode(self::MODE_FILE);
		$this->send($file);

		return $this;
	}
606829
public function setFile($file): self
    {
        $this->file = $file;

        if (is_string($file)) {
            $this->pathToFile = $file;
            $this->setFileName(pathinfo($file, PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file, PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof UploadedFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName($file->getClientOriginalName());
            $this->mediaName = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof SymfonyFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName(pathinfo($file->getFilename(), PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file->getFilename(), PATHINFO_FILENAME);

            return $this;
        }

        throw UnknownType::create();
    }
422455
public function setSender($sender)
    {
        if (is_string($sender)) {
            $sender = new Sender($sender);
        } elseif (!$sender instanceof Sender) {
            throw new \InvalidArgumentException('$sender must be a string or an instance of Sender.');
        }

        $this->sender = $sender;

        return $this;
    }
1157222
public function setFile($file)
    {

        //Return false if file does not exists;
        if (!$this->isFile($file)) {
            return false;
        }
        //Get the file info
        $this->file = $file;
        $this->pathinfo[$file] = pathinfo($file);

        //Return an instance of the file object;
        return $this;
    }
189295
public function add($file, $entry_name = null)
    {
        $result = $this->tar->addModify($file, '', dirname($file));
        if ($result === false) {
            throw new ArchiveException('Error adding file ' . $file);
        }

        return $this;
    }
1367718
public function copy(string $destination, $overwrite = false) : bool
    {
        $copied = false;

        if ($this->isFile()) {
            $exists = file_exists($destination);
            if (!$exists || ($exists && $overwrite)) {
                $copied = copy($this->realPath, $destination);
            }
        }

        return $copied;
    }
406195
public function setRunningFile($file)
    {
        if (false === is_file($file)) {
            throw InvalidArgumentException::create(
                'The file "%s" is not a file or it does not exist.',
                $file
            );
        }

        $this->runningFile = $file;
    }
973477
public function setFileInput($file, $mode = DATA_MANIPULATION_CREATE_MODE_AUTO, $extension = null)
    {
        $this->setFilename($file);
        if ($mode == DATA_MANIPULATION_CREATE_MODE_AUTO) {
            $mode = $this->getModeByFile($file, $extension);
        }
        if ($mode == DATA_MANIPULATION_CREATE_MODE_ODS) {
            $this->setCore(new CSVManipulator());
        } else if ($mode == DATA_MANIPULATION_CREATE_MODE_XLS) {
            $this->setCore(new XLSManipulator());
        } else if ($mode == DATA_MANIPULATION_CREATE_MODE_XLSX) {
            $this->setCore(new XLSXManipulator());
        } else {
            $this->setCore(new CSVManipulator());
        }
    }
358426
public function setFile($file, $contentDisposition = null, $autoLastModified = true)
    {
        $this->file = $file;

        if ($autoLastModified) {
            $this->setAutoLastModified();
        }

        if ($contentDisposition) {
            $this->setContentDisposition($contentDisposition);
        }

        return $this;
    }
1193499
public function add($file, $entry_name = null)
    {
        // Make sure to adapt the entry name as the original filename.
        if (!isset($entry_name)) {
            $entry_name = basename($file);
        }
        $result = $this->zip->addFile($file, $entry_name);
        if ($result === false) {
            throw new ArchiveException('Error adding ' . $file);
        }

        return $this;
    }
983314
public function writeFile()
    {
        if (!empty($this->fileName)) {
            if (!file_exists($this->destinationPath)) {
                mkdir($this->destinationPath, 0777);
            }
            $file = $this->file();
            $fileHandle = fopen($file, 'w+');
            fwrite($fileHandle, $this->body);
            fclose($fileHandle);
            return $file;
        } else {
            return FALSE;
        }
    }
156093
public function setFile(File $file = null)
    {
        $this->file = $file;

        if (!empty($file)) {
            $size = @getimagesize($file->getPathname());

            if (is_array($size)) {
                list($this->width, $this->height) = $size;
            }

            $this->refreshUpdatedAt();
        }

        return $this;
    }
1024689
public function putFromPath($local_file)
    {
        $remote_file = basename($local_file);
        $handle      = fopen($local_file, 'r');

        if ($this->ftp->fput($remote_file, $handle, FTP_BINARY)) {
            rewind($handle);
            return $this;
        }

        throw new FtpException(
            'Unable to put the remote file from the local file "'.$local_file.'"'
        );
    }
705120
public function setSrcfile($file)
    {
        if (is_string($file)) {
            $file = new PhingFile($file);
        }
        $this->_sourceFile = $file;
    }
793447
public static function assertDestinationInstanceOf($destination, string $class): void
    {
        if (!$destination instanceof $class) {
            throw new static(sprintf(
                'The destination must be an instance of %s but got %s.',
                $class,
                is_object($destination) ? get_class($destination) : gettype($destination)
            ));
        }
    }