Box\Spout\Writer\AbstractWriter::closeAndAttemptToCleanupAllFiles PHP Method

closeAndAttemptToCleanupAllFiles() private method

Closes the writer and attempts to cleanup all files that were created during the writing process (temp files & final file).
    private function closeAndAttemptToCleanupAllFiles()
    {
        // close the writer, which should remove all temp files
        $this->close();
        // remove output file if it was created
        if ($this->globalFunctionsHelper->file_exists($this->outputFilePath)) {
            $outputFolderPath = dirname($this->outputFilePath);
            $fileSystemHelper = new FileSystemHelper($outputFolderPath);
            $fileSystemHelper->deleteFile($this->outputFilePath);
        }
    }