diff --git a/lib/openspout/README.md b/lib/openspout/README.md index d7499fc08da..a94eb45ae45 100644 --- a/lib/openspout/README.md +++ b/lib/openspout/README.md @@ -3,7 +3,7 @@ [![Latest Stable Version](https://poser.pugx.org/openspout/openspout/v/stable)](https://packagist.org/packages/openspout/openspout) [![Total Downloads](https://poser.pugx.org/openspout/openspout/downloads)](https://packagist.org/packages/openspout/openspout) [![Build Status](https://github.com/openspout/openspout/actions/workflows/ci.yml/badge.svg)](https://github.com/openspout/openspout/actions/workflows/ci.yml) -[![Infection MSI](https://badge.stryker-mutator.io/github.com/openspout/openspout/4.x)](https://dashboard.stryker-mutator.io/reports/github.com/openspout/openspout/4.x) +[![Infection MSI](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fopenspout%2Fopenspout%2F4.x)](https://dashboard.stryker-mutator.io/reports/github.com/openspout/openspout/4.x) OpenSpout is a community driven fork of `box/spout`, a PHP library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way. Unlike other file readers or writers, it is capable of processing diff --git a/lib/openspout/src/Common/Helper/EncodingHelper.php b/lib/openspout/src/Common/Helper/EncodingHelper.php index 7facf216d97..d1fc51f1d9e 100644 --- a/lib/openspout/src/Common/Helper/EncodingHelper.php +++ b/lib/openspout/src/Common/Helper/EncodingHelper.php @@ -183,7 +183,7 @@ final class EncodingHelper $convertedString = false; } } else { - throw new EncodingConversionException("The conversion from {$sourceEncoding} to {$targetEncoding} is not supported. Please install \"iconv\" or \"PHP Intl\"."); + throw new EncodingConversionException("The conversion from {$sourceEncoding} to {$targetEncoding} is not supported. Please install \"iconv\" or \"mbstring\"."); } if (false === $convertedString) { diff --git a/lib/openspout/src/Common/Helper/StringHelper.php b/lib/openspout/src/Common/Helper/StringHelper.php index 310d4243042..dfc6d56d7f9 100644 --- a/lib/openspout/src/Common/Helper/StringHelper.php +++ b/lib/openspout/src/Common/Helper/StringHelper.php @@ -33,8 +33,7 @@ final class StringHelper { return $this->hasMbstringSupport ? mb_strlen($string) - : \strlen($string) // @codeCoverageIgnore - ; + : \strlen($string); // @codeCoverageIgnore } /** @@ -53,8 +52,7 @@ final class StringHelper { $position = $this->hasMbstringSupport ? mb_strpos($string, $char) - : strpos($string, $char) // @codeCoverageIgnore - ; + : strpos($string, $char); // @codeCoverageIgnore return (false !== $position) ? $position : -1; } @@ -75,8 +73,7 @@ final class StringHelper { $position = $this->hasMbstringSupport ? mb_strrpos($string, $char) - : strrpos($string, $char) // @codeCoverageIgnore - ; + : strrpos($string, $char); // @codeCoverageIgnore return (false !== $position) ? $position : -1; } diff --git a/lib/openspout/src/Reader/CSV/RowIterator.php b/lib/openspout/src/Reader/CSV/RowIterator.php index 024711b8e1b..88b7c00cc9b 100644 --- a/lib/openspout/src/Reader/CSV/RowIterator.php +++ b/lib/openspout/src/Reader/CSV/RowIterator.php @@ -158,8 +158,7 @@ final class RowIterator implements RowIteratorInterface return (!$hasSuccessfullyFetchedRowData && !$hasNowReachedEndOfFile) - || (!$this->options->SHOULD_PRESERVE_EMPTY_ROWS && $isEmptyLine) - ; + || (!$this->options->SHOULD_PRESERVE_EMPTY_ROWS && $isEmptyLine); } /** diff --git a/lib/openspout/src/Reader/ODS/RowIterator.php b/lib/openspout/src/Reader/ODS/RowIterator.php index caac67eee85..9bdbbd20350 100644 --- a/lib/openspout/src/Reader/ODS/RowIterator.php +++ b/lib/openspout/src/Reader/ODS/RowIterator.php @@ -172,8 +172,7 @@ final class RowIterator implements RowIteratorInterface return !$hasReadAtLeastOneRow - || $this->lastRowIndexProcessed === $this->nextRowIndexToBeProcessed - 1 - ; + || $this->lastRowIndexProcessed === $this->nextRowIndexToBeProcessed - 1; } /** @@ -337,7 +336,6 @@ final class RowIterator implements RowIteratorInterface { return $currentRow->isEmpty() - && (null === $lastReadCell || $lastReadCell instanceof Cell\EmptyCell) - ; + && (null === $lastReadCell || $lastReadCell instanceof Cell\EmptyCell); } } diff --git a/lib/openspout/src/Reader/ODS/SheetIterator.php b/lib/openspout/src/Reader/ODS/SheetIterator.php index d0d40f508f3..9d66d1068ad 100644 --- a/lib/openspout/src/Reader/ODS/SheetIterator.php +++ b/lib/openspout/src/Reader/ODS/SheetIterator.php @@ -210,8 +210,7 @@ final class SheetIterator implements SheetIteratorInterface // or if no information about the active sheet was found, it defaults to the first sheet. return (null === $activeSheetName && 0 === $sheetIndex) - || ($activeSheetName === $sheetName) - ; + || ($activeSheetName === $sheetName); } /** diff --git a/lib/openspout/src/Reader/XLSX/Helper/CellValueFormatter.php b/lib/openspout/src/Reader/XLSX/Helper/CellValueFormatter.php index 9f15fb48091..4a4548db664 100644 --- a/lib/openspout/src/Reader/XLSX/Helper/CellValueFormatter.php +++ b/lib/openspout/src/Reader/XLSX/Helper/CellValueFormatter.php @@ -226,8 +226,7 @@ final class CellValueFormatter // @NOTE: some versions of Excel don't support negative dates (e.g. Excel for Mac 2011) return $this->shouldUse1904Dates && $timestampValue >= -695055 && $timestampValue <= 2957003.9999884 - || !$this->shouldUse1904Dates && $timestampValue >= -693593 && $timestampValue <= 2958465.9999884 - ; + || !$this->shouldUse1904Dates && $timestampValue >= -693593 && $timestampValue <= 2958465.9999884; } /** diff --git a/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactory.php b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactory.php index 3ec42cdc434..ac1a71d6c43 100644 --- a/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactory.php +++ b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactory.php @@ -7,7 +7,7 @@ namespace OpenSpout\Reader\XLSX\Manager\SharedStringsCaching; /** * @internal */ -final class CachingStrategyFactory +final class CachingStrategyFactory implements CachingStrategyFactoryInterface { /** * The memory amount needed to store a string was obtained empirically from this data:. diff --git a/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactoryInterface.php b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactoryInterface.php new file mode 100644 index 00000000000..a506da731dc --- /dev/null +++ b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsCaching/CachingStrategyFactoryInterface.php @@ -0,0 +1,19 @@ +maxNumStringsPerTempFile); - return $this->tempFolder.'/sharedstrings'.$numTempFile; + return $this->tempFolder.\DIRECTORY_SEPARATOR.'sharedstrings'.$numTempFile; } /** diff --git a/lib/openspout/src/Reader/XLSX/Manager/SharedStringsManager.php b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsManager.php index 499559c8470..9a129a18f5f 100644 --- a/lib/openspout/src/Reader/XLSX/Manager/SharedStringsManager.php +++ b/lib/openspout/src/Reader/XLSX/Manager/SharedStringsManager.php @@ -8,7 +8,7 @@ use DOMElement; use OpenSpout\Common\Exception\IOException; use OpenSpout\Reader\Exception\XMLProcessingException; use OpenSpout\Reader\Wrapper\XMLReader; -use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactory; +use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactoryInterface; use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyInterface; use OpenSpout\Reader\XLSX\Options; @@ -41,8 +41,8 @@ final class SharedStringsManager /** @var WorkbookRelationshipsManager Helps retrieving workbook relationships */ private WorkbookRelationshipsManager $workbookRelationshipsManager; - /** @var CachingStrategyFactory Factory to create shared strings caching strategies */ - private CachingStrategyFactory $cachingStrategyFactory; + /** @var CachingStrategyFactoryInterface Factory to create shared strings caching strategies */ + private CachingStrategyFactoryInterface $cachingStrategyFactory; /** @var CachingStrategyInterface The best caching strategy for storing shared strings */ private CachingStrategyInterface $cachingStrategy; @@ -51,7 +51,7 @@ final class SharedStringsManager string $filePath, Options $options, WorkbookRelationshipsManager $workbookRelationshipsManager, - CachingStrategyFactory $cachingStrategyFactory + CachingStrategyFactoryInterface $cachingStrategyFactory ) { $this->filePath = $filePath; $this->options = $options; @@ -199,8 +199,7 @@ final class SharedStringsManager $sharedStringValue .= $shouldPreserveWhitespace ? $textNodeValue - : trim($textNodeValue) - ; + : trim($textNodeValue); } } diff --git a/lib/openspout/src/Reader/XLSX/Reader.php b/lib/openspout/src/Reader/XLSX/Reader.php index f08df2f000f..a87b78e17d9 100644 --- a/lib/openspout/src/Reader/XLSX/Reader.php +++ b/lib/openspout/src/Reader/XLSX/Reader.php @@ -8,6 +8,7 @@ use OpenSpout\Common\Exception\IOException; use OpenSpout\Common\Helper\Escaper\XLSX; use OpenSpout\Reader\AbstractReader; use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactory; +use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactoryInterface; use OpenSpout\Reader\XLSX\Manager\SharedStringsCaching\MemoryLimit; use OpenSpout\Reader\XLSX\Manager\SharedStringsManager; use OpenSpout\Reader\XLSX\Manager\SheetManager; @@ -28,18 +29,16 @@ final class Reader extends AbstractReader private SheetIterator $sheetIterator; private Options $options; - private CachingStrategyFactory $cachingStrategyFactory; + private CachingStrategyFactoryInterface $cachingStrategyFactory; public function __construct( ?Options $options = null, - ?CachingStrategyFactory $cachingStrategyFactory = null + ?CachingStrategyFactoryInterface $cachingStrategyFactory = null ) { $this->options = $options ?? new Options(); if (null === $cachingStrategyFactory) { $memoryLimit = \ini_get('memory_limit'); - \assert(false !== $memoryLimit); - $cachingStrategyFactory = new CachingStrategyFactory(new MemoryLimit($memoryLimit)); } $this->cachingStrategyFactory = $cachingStrategyFactory; diff --git a/lib/openspout/src/Reader/XLSX/RowIterator.php b/lib/openspout/src/Reader/XLSX/RowIterator.php index e1c7d2d920c..b5ca46cc57e 100644 --- a/lib/openspout/src/Reader/XLSX/RowIterator.php +++ b/lib/openspout/src/Reader/XLSX/RowIterator.php @@ -247,8 +247,7 @@ final class RowIterator implements RowIteratorInterface return !$hasReadAtLeastOneRow || !$this->shouldPreserveEmptyRows - || $this->lastRowIndexProcessed < $this->nextRowIndexToBeProcessed - ; + || $this->lastRowIndexProcessed < $this->nextRowIndexToBeProcessed; } /** @@ -297,7 +296,7 @@ final class RowIterator implements RowIteratorInterface // Read spans info if present $numberOfColumnsForRow = $this->numColumns; $spans = $xmlReader->getAttribute(self::XML_ATTRIBUTE_SPANS); // returns '1:5' for instance - if (null !== $spans) { + if (null !== $spans && '' !== $spans) { [, $numberOfColumnsForRow] = explode(':', $spans); $numberOfColumnsForRow = (int) $numberOfColumnsForRow; } @@ -367,7 +366,7 @@ final class RowIterator implements RowIteratorInterface * * @return int Row index * - *@throws \OpenSpout\Common\Exception\InvalidArgumentException When the given cell index is invalid + * @throws \OpenSpout\Common\Exception\InvalidArgumentException When the given cell index is invalid */ private function getRowIndex(XMLReader $xmlReader): int { @@ -384,7 +383,7 @@ final class RowIterator implements RowIteratorInterface * * @return int Column index * - *@throws \OpenSpout\Common\Exception\InvalidArgumentException When the given cell index is invalid + * @throws \OpenSpout\Common\Exception\InvalidArgumentException When the given cell index is invalid */ private function getColumnIndex(XMLReader $xmlReader): int { diff --git a/lib/openspout/src/Writer/AbstractWriter.php b/lib/openspout/src/Writer/AbstractWriter.php index 9f0633a5ea6..eef34fb4c55 100644 --- a/lib/openspout/src/Writer/AbstractWriter.php +++ b/lib/openspout/src/Writer/AbstractWriter.php @@ -13,6 +13,9 @@ abstract class AbstractWriter implements WriterInterface /** @var resource Pointer to the file/stream we will write to */ protected $filePointer; + /** @var string document creator */ + protected string $creator = 'OpenSpout'; + /** @var string Content-Type value for the header - to be defined by child class */ protected static string $headerContentType; @@ -25,9 +28,6 @@ abstract class AbstractWriter implements WriterInterface /** @var 0|positive-int */ private int $writtenRowCount = 0; - /** - * {@inheritdoc} - */ final public function openToFile($outputFilePath): void { $this->outputFilePath = $outputFilePath; @@ -53,7 +53,8 @@ abstract class AbstractWriter implements WriterInterface /** * @codeCoverageIgnore - * {@inheritdoc} + * + * @param mixed $outputFileName */ final public function openToBrowser($outputFileName): void { @@ -104,9 +105,6 @@ abstract class AbstractWriter implements WriterInterface $this->isWriterOpened = true; } - /** - * {@inheritdoc} - */ final public function addRow(Row $row): void { if (!$this->isWriterOpened) { @@ -117,9 +115,6 @@ abstract class AbstractWriter implements WriterInterface ++$this->writtenRowCount; } - /** - * {@inheritdoc} - */ final public function addRows(array $rows): void { foreach ($rows as $row) { @@ -127,17 +122,16 @@ abstract class AbstractWriter implements WriterInterface } } - /** - * {@inheritdoc} - */ + final public function setCreator(string $creator): void + { + $this->creator = $creator; + } + final public function getWrittenRowCount(): int { return $this->writtenRowCount; } - /** - * {@inheritdoc} - */ final public function close(): void { if (!$this->isWriterOpened) { diff --git a/lib/openspout/src/Writer/AbstractWriterMultiSheets.php b/lib/openspout/src/Writer/AbstractWriterMultiSheets.php index be61aa07011..c1bae86d424 100644 --- a/lib/openspout/src/Writer/AbstractWriterMultiSheets.php +++ b/lib/openspout/src/Writer/AbstractWriterMultiSheets.php @@ -83,9 +83,6 @@ abstract class AbstractWriterMultiSheets extends AbstractWriter abstract protected function createWorkbookManager(): WorkbookManagerInterface; - /** - * {@inheritdoc} - */ protected function openWriter(): void { if (!isset($this->workbookManager)) { @@ -95,8 +92,6 @@ abstract class AbstractWriterMultiSheets extends AbstractWriter } /** - * {@inheritdoc} - * * @throws Exception\WriterException */ protected function addRowToWriter(Row $row): void @@ -105,9 +100,6 @@ abstract class AbstractWriterMultiSheets extends AbstractWriter $this->workbookManager->addRowToCurrentWorksheet($row); } - /** - * {@inheritdoc} - */ protected function closeWriter(): void { if (isset($this->workbookManager)) { diff --git a/lib/openspout/src/Writer/Common/Manager/WorkbookManagerInterface.php b/lib/openspout/src/Writer/Common/Manager/WorkbookManagerInterface.php index 13082835be3..aecde4fbdd7 100644 --- a/lib/openspout/src/Writer/Common/Manager/WorkbookManagerInterface.php +++ b/lib/openspout/src/Writer/Common/Manager/WorkbookManagerInterface.php @@ -7,7 +7,6 @@ namespace OpenSpout\Writer\Common\Manager; use OpenSpout\Common\Entity\Row; use OpenSpout\Common\Exception\IOException; use OpenSpout\Writer\Common\Entity\Sheet; -use OpenSpout\Writer\Common\Entity\Workbook; use OpenSpout\Writer\Common\Entity\Worksheet; use OpenSpout\Writer\Exception\SheetNotFoundException; use OpenSpout\Writer\Exception\WriterException; diff --git a/lib/openspout/src/Writer/ODS/Helper/FileSystemHelper.php b/lib/openspout/src/Writer/ODS/Helper/FileSystemHelper.php index 12f07ac4658..a2545eae061 100644 --- a/lib/openspout/src/Writer/ODS/Helper/FileSystemHelper.php +++ b/lib/openspout/src/Writer/ODS/Helper/FileSystemHelper.php @@ -17,7 +17,6 @@ use OpenSpout\Writer\ODS\Manager\WorksheetManager; */ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface { - public const APP_NAME = 'OpenSpout'; public const MIMETYPE = 'application/vnd.oasis.opendocument.spreadsheet'; public const META_INF_FOLDER_NAME = 'META-INF'; @@ -29,6 +28,9 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface public const STYLES_XML_FILE_NAME = 'styles.xml'; private string $baseFolderRealPath; + + /** @var string document creator */ + private string $creator; private CommonFileSystemHelper $baseFileSystemHelper; /** @var string Path to the root folder inside the temp folder where the files to create the ODS will be stored */ @@ -46,12 +48,14 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface /** * @param string $baseFolderPath The path of the base folder where all the I/O can occur * @param ZipHelper $zipHelper Helper to perform tasks with Zip archive + * @param string $creator document creator */ - public function __construct(string $baseFolderPath, ZipHelper $zipHelper) + public function __construct(string $baseFolderPath, ZipHelper $zipHelper, string $creator) { $this->baseFileSystemHelper = new CommonFileSystemHelper($baseFolderPath); $this->baseFolderRealPath = $this->baseFileSystemHelper->getBaseFolderRealPath(); $this->zipHelper = $zipHelper; + $this->creator = $creator; } public function createFolder(string $parentFolderPath, string $folderName): string @@ -275,14 +279,13 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface */ private function createMetaFile(): self { - $appName = self::APP_NAME; $createdDate = (new DateTimeImmutable())->format(DateTimeImmutable::W3C); $metaXmlFileContents = << - {$appName} + {$this->creator} {$createdDate} {$createdDate} diff --git a/lib/openspout/src/Writer/ODS/Manager/WorkbookManager.php b/lib/openspout/src/Writer/ODS/Manager/WorkbookManager.php index 0da68f458f0..750e0ca2e9c 100644 --- a/lib/openspout/src/Writer/ODS/Manager/WorkbookManager.php +++ b/lib/openspout/src/Writer/ODS/Manager/WorkbookManager.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace OpenSpout\Writer\ODS\Manager; -use OpenSpout\Writer\Common\Entity\Sheet; use OpenSpout\Writer\Common\Entity\Workbook; use OpenSpout\Writer\Common\Manager\AbstractWorkbookManager; use OpenSpout\Writer\Common\Manager\Style\StyleMerger; diff --git a/lib/openspout/src/Writer/ODS/Writer.php b/lib/openspout/src/Writer/ODS/Writer.php index 487fb6a30da..665e186bc5e 100644 --- a/lib/openspout/src/Writer/ODS/Writer.php +++ b/lib/openspout/src/Writer/ODS/Writer.php @@ -35,7 +35,7 @@ final class Writer extends AbstractWriterMultiSheets { $workbook = new Workbook(); - $fileSystemHelper = new FileSystemHelper($this->options->getTempFolder(), new ZipHelper()); + $fileSystemHelper = new FileSystemHelper($this->options->getTempFolder(), new ZipHelper(), $this->creator); $fileSystemHelper->createBaseFilesAndFolders(); $styleMerger = new StyleMerger(); diff --git a/lib/openspout/src/Writer/WriterInterface.php b/lib/openspout/src/Writer/WriterInterface.php index ac43e33e4e8..c294d6d16fc 100644 --- a/lib/openspout/src/Writer/WriterInterface.php +++ b/lib/openspout/src/Writer/WriterInterface.php @@ -49,6 +49,13 @@ interface WriterInterface */ public function addRows(array $rows): void; + /** + * Set document creator. + * + * @param string $creator document creator + */ + public function setCreator(string $creator): void; + /** * @return 0|positive-int */ diff --git a/lib/openspout/src/Writer/XLSX/Helper/DateHelper.php b/lib/openspout/src/Writer/XLSX/Helper/DateHelper.php index b18a9453157..8fc4d346c80 100644 --- a/lib/openspout/src/Writer/XLSX/Helper/DateHelper.php +++ b/lib/openspout/src/Writer/XLSX/Helper/DateHelper.php @@ -48,8 +48,7 @@ final class DateHelper + $day + 1721119 - $myexcelBaseDate - + $excel1900isLeapYear - ; + + $excel1900isLeapYear; $excelTime = (($hours * 3600) + ($minutes * 60) + $seconds) / 86400; diff --git a/lib/openspout/src/Writer/XLSX/Helper/FileSystemHelper.php b/lib/openspout/src/Writer/XLSX/Helper/FileSystemHelper.php index 9a1e7174144..ba1293f96c1 100644 --- a/lib/openspout/src/Writer/XLSX/Helper/FileSystemHelper.php +++ b/lib/openspout/src/Writer/XLSX/Helper/FileSystemHelper.php @@ -21,8 +21,6 @@ use OpenSpout\Writer\XLSX\Options; */ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface { - public const APP_NAME = 'OpenSpout'; - public const RELS_FOLDER_NAME = '_rels'; public const DRAWINGS_FOLDER_NAME = 'drawings'; public const DOC_PROPS_FOLDER_NAME = 'docProps'; @@ -48,6 +46,9 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface /** @var ZipHelper Helper to perform tasks with Zip archive */ private ZipHelper $zipHelper; + /** @var string document creator */ + private string $creator; + /** @var XLSX Used to escape XML data */ private XLSX $escaper; @@ -76,13 +77,15 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface * @param string $baseFolderPath The path of the base folder where all the I/O can occur * @param ZipHelper $zipHelper Helper to perform tasks with Zip archive * @param XLSX $escaper Used to escape XML data + * @param string $creator document creator */ - public function __construct(string $baseFolderPath, ZipHelper $zipHelper, XLSX $escaper) + public function __construct(string $baseFolderPath, ZipHelper $zipHelper, XLSX $escaper, string $creator) { $this->baseFileSystemHelper = new CommonFileSystemHelper($baseFolderPath); $this->baseFolderRealPath = $this->baseFileSystemHelper->getBaseFolderRealPath(); $this->zipHelper = $zipHelper; $this->escaper = $escaper; + $this->creator = $creator; } public function createFolder(string $parentFolderPath, string $folderName): string @@ -516,11 +519,10 @@ final class FileSystemHelper implements FileSystemWithRootFolderHelperInterface */ private function createAppXmlFile(): self { - $appName = self::APP_NAME; $appXmlFileContents = << - {$appName} + {$this->creator} 0 EOD; diff --git a/lib/openspout/src/Writer/XLSX/Manager/WorkbookManager.php b/lib/openspout/src/Writer/XLSX/Manager/WorkbookManager.php index 8404c47041f..082951753f1 100644 --- a/lib/openspout/src/Writer/XLSX/Manager/WorkbookManager.php +++ b/lib/openspout/src/Writer/XLSX/Manager/WorkbookManager.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace OpenSpout\Writer\XLSX\Manager; -use OpenSpout\Writer\Common\Entity\Sheet; use OpenSpout\Writer\Common\Entity\Workbook; use OpenSpout\Writer\Common\Manager\AbstractWorkbookManager; use OpenSpout\Writer\Common\Manager\Style\StyleMerger; diff --git a/lib/openspout/src/Writer/XLSX/Manager/WorksheetManager.php b/lib/openspout/src/Writer/XLSX/Manager/WorksheetManager.php index e0e448a29f5..2c43d638d55 100644 --- a/lib/openspout/src/Writer/XLSX/Manager/WorksheetManager.php +++ b/lib/openspout/src/Writer/XLSX/Manager/WorksheetManager.php @@ -80,9 +80,6 @@ final class WorksheetManager implements WorksheetManagerInterface return $this->sharedStringsManager; } - /** - * {@inheritdoc} - */ public function startSheet(Worksheet $worksheet): void { $sheetFilePointer = fopen($worksheet->getFilePath(), 'w'); @@ -92,9 +89,6 @@ final class WorksheetManager implements WorksheetManagerInterface $this->commentsManager->createWorksheetCommentFiles($worksheet); } - /** - * {@inheritdoc} - */ public function addRow(Worksheet $worksheet, Row $row): void { if (!$row->isEmpty()) { @@ -105,9 +99,6 @@ final class WorksheetManager implements WorksheetManagerInterface $worksheet->setLastWrittenRowIndex($worksheet->getLastWrittenRowIndex() + 1); } - /** - * {@inheritdoc} - */ public function close(Worksheet $worksheet): void { $this->commentsManager->closeWorksheetCommentFiles($worksheet); diff --git a/lib/openspout/src/Writer/XLSX/Writer.php b/lib/openspout/src/Writer/XLSX/Writer.php index 4c4410a5474..3fdbecb5cd9 100644 --- a/lib/openspout/src/Writer/XLSX/Writer.php +++ b/lib/openspout/src/Writer/XLSX/Writer.php @@ -42,7 +42,8 @@ final class Writer extends AbstractWriterMultiSheets $fileSystemHelper = new FileSystemHelper( $this->options->getTempFolder(), new ZipHelper(), - new XLSX() + new XLSX(), + $this->creator ); $fileSystemHelper->createBaseFilesAndFolders(); diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml index 7ac7d515dc3..d724c291335 100644 --- a/lib/thirdpartylibs.xml +++ b/lib/thirdpartylibs.xml @@ -377,7 +377,7 @@ All rights reserved. openspout OpenSpout Library to read and write spreadsheet files (CSV, XLSX and ODS). - 4.13.0 + 4.15.0 MIT https://github.com/openspout/openspout