public function close($finalFilePointer)
    {
        /** @var Worksheet[] $worksheets */
        $worksheets = $this->worksheets;
        $numWorksheets = count($worksheets);

        foreach ($worksheets as $worksheet) {
            $worksheet->close();
        }

        // Finish creating all the necessary files before zipping everything together
        $this->fileSystemHelper
            ->createContentFile($worksheets, $this->styleHelper)
            ->deleteWorksheetTempFolder()
            ->createStylesFile($this->styleHelper, $numWorksheets)
            ->zipRootFolderAndCopyToStream($finalFilePointer);

        $this->cleanupTempFolder();
    }