public function setDestination($destinationFile) { if (!$this->pathHelper->isValid(dirname($destinationFile))) { mkdir(dirname($destinationFile), 0777, true); } $this->pathHelper->validatePath(dirname($destinationFile)); $this->destinationDirectory = realpath(dirname($destinationFile)); $this->destinationFileName = basename($destinationFile); $this->destinationFile = "{$this->destinationDirectory}/{$this->destinationFileName}"; }