diff --git a/lib/Spout/Autoloader/Psr4Autoloader.php b/lib/Spout/Autoloader/Psr4Autoloader.php index 1699293426d5d7ccbb736e8a3d559114b9ee7f5d..37b6d4ac1092f2d22d75ef203b6638e910692650 100644 --- a/lib/Spout/Autoloader/Psr4Autoloader.php +++ b/lib/Spout/Autoloader/Psr4Autoloader.php @@ -23,7 +23,7 @@ class Psr4Autoloader */ public function register() { - spl_autoload_register([$this, 'loadClass']); + \spl_autoload_register([$this, 'loadClass']); } /** @@ -40,10 +40,10 @@ class Psr4Autoloader public function addNamespace($prefix, $baseDir, $prepend = false) { // normalize namespace prefix - $prefix = trim($prefix, '\\') . '\\'; + $prefix = \trim($prefix, '\\') . '\\'; // normalize the base directory with a trailing separator - $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/'; + $baseDir = \rtrim($baseDir, DIRECTORY_SEPARATOR) . '/'; // initialize the namespace prefix array if (isset($this->prefixes[$prefix]) === false) { @@ -52,9 +52,9 @@ class Psr4Autoloader // retain the base directory for the namespace prefix if ($prepend) { - array_unshift($this->prefixes[$prefix], $baseDir); + \array_unshift($this->prefixes[$prefix], $baseDir); } else { - array_push($this->prefixes[$prefix], $baseDir); + \array_push($this->prefixes[$prefix], $baseDir); } } @@ -72,12 +72,12 @@ class Psr4Autoloader // work backwards through the namespace names of the fully-qualified // class name to find a mapped file name - while (($pos = strrpos($prefix, '\\')) !== false) { + while (($pos = \strrpos($prefix, '\\')) !== false) { // retain the trailing namespace separator in the prefix - $prefix = substr($class, 0, $pos + 1); + $prefix = \substr($class, 0, $pos + 1); // the rest is the relative class name - $relativeClass = substr($class, $pos + 1); + $relativeClass = \substr($class, $pos + 1); // try to load a mapped file for the prefix and relative class $mappedFile = $this->loadMappedFile($prefix, $relativeClass); @@ -87,7 +87,7 @@ class Psr4Autoloader // remove the trailing namespace separator for the next iteration // of strrpos() - $prefix = rtrim($prefix, '\\'); + $prefix = \rtrim($prefix, '\\'); } // never found a mapped file @@ -115,7 +115,7 @@ class Psr4Autoloader // replace namespace separators with directory separators // in the relative class name, append with .php $file = $baseDir - . str_replace('\\', '/', $relativeClass) + . \str_replace('\\', '/', $relativeClass) . '.php'; // if the mapped file exists, require it @@ -137,7 +137,7 @@ class Psr4Autoloader */ protected function requireFile($file) { - if (file_exists($file)) { + if (\file_exists($file)) { require $file; return true; diff --git a/lib/Spout/Autoloader/autoload.php b/lib/Spout/Autoloader/autoload.php index e08ee344bd8d44fd38e74822bea1a8872dd69417..44468a72815c4542325a1bd616e9556439c1fbfc 100644 --- a/lib/Spout/Autoloader/autoload.php +++ b/lib/Spout/Autoloader/autoload.php @@ -8,7 +8,7 @@ require_once 'Psr4Autoloader.php'; * @var string * Full path to "src/Spout" which is what we want "Box\Spout" to map to. */ -$srcBaseDirectory = dirname(dirname(__FILE__)); +$srcBaseDirectory = \dirname(\dirname(__FILE__)); $loader = new Psr4Autoloader(); $loader->register(); diff --git a/lib/Spout/Common/Helper/EncodingHelper.php b/lib/Spout/Common/Helper/EncodingHelper.php index 90642743a3b5309b8910792d50b569b4d5093bd8..62ddf60bd5625dc72ea9543f8d541f7d95d215d8 100644 --- a/lib/Spout/Common/Helper/EncodingHelper.php +++ b/lib/Spout/Common/Helper/EncodingHelper.php @@ -61,7 +61,7 @@ class EncodingHelper $bomUsed = $this->supportedEncodingsWithBom[$encoding]; // we skip the N first bytes - $byteOffsetToSkipBom = strlen($bomUsed); + $byteOffsetToSkipBom = \strlen($bomUsed); } return $byteOffsetToSkipBom; @@ -80,9 +80,9 @@ class EncodingHelper $this->globalFunctionsHelper->rewind($filePointer); - if (array_key_exists($encoding, $this->supportedEncodingsWithBom)) { + if (\array_key_exists($encoding, $this->supportedEncodingsWithBom)) { $potentialBom = $this->supportedEncodingsWithBom[$encoding]; - $numBytesInBom = strlen($potentialBom); + $numBytesInBom = \strlen($potentialBom); $hasBOM = ($this->globalFunctionsHelper->fgets($filePointer, $numBytesInBom + 1) === $potentialBom); } diff --git a/lib/Spout/Common/Helper/FileSystemHelper.php b/lib/Spout/Common/Helper/FileSystemHelper.php index b1bff8fc85c29d761bb54450f25a7a582bc2892b..4d5d223dc70a52582d77038cb12d05fdce845348 100644 --- a/lib/Spout/Common/Helper/FileSystemHelper.php +++ b/lib/Spout/Common/Helper/FileSystemHelper.php @@ -19,7 +19,7 @@ class FileSystemHelper implements FileSystemHelperInterface */ public function __construct($baseFolderPath) { - $this->baseFolderRealPath = realpath($baseFolderPath); + $this->baseFolderRealPath = \realpath($baseFolderPath); } /** @@ -36,7 +36,7 @@ class FileSystemHelper implements FileSystemHelperInterface $folderPath = $parentFolderPath . '/' . $folderName; - $wasCreationSuccessful = mkdir($folderPath, 0777, true); + $wasCreationSuccessful = \mkdir($folderPath, 0777, true); if (!$wasCreationSuccessful) { throw new IOException("Unable to create folder: $folderPath"); } @@ -60,7 +60,7 @@ class FileSystemHelper implements FileSystemHelperInterface $filePath = $parentFolderPath . '/' . $fileName; - $wasCreationSuccessful = file_put_contents($filePath, $fileContents); + $wasCreationSuccessful = \file_put_contents($filePath, $fileContents); if ($wasCreationSuccessful === false) { throw new IOException("Unable to create file: $filePath"); } @@ -79,8 +79,8 @@ class FileSystemHelper implements FileSystemHelperInterface { $this->throwIfOperationNotInBaseFolder($filePath); - if (file_exists($filePath) && is_file($filePath)) { - unlink($filePath); + if (\file_exists($filePath) && \is_file($filePath)) { + \unlink($filePath); } } @@ -102,13 +102,13 @@ class FileSystemHelper implements FileSystemHelperInterface foreach ($itemIterator as $item) { if ($item->isDir()) { - rmdir($item->getPathname()); + \rmdir($item->getPathname()); } else { - unlink($item->getPathname()); + \unlink($item->getPathname()); } } - rmdir($folderPath); + \rmdir($folderPath); } /** @@ -122,8 +122,8 @@ class FileSystemHelper implements FileSystemHelperInterface */ protected function throwIfOperationNotInBaseFolder($operationFolderPath) { - $operationFolderRealPath = realpath($operationFolderPath); - $isInBaseFolder = (strpos($operationFolderRealPath, $this->baseFolderRealPath) === 0); + $operationFolderRealPath = \realpath($operationFolderPath); + $isInBaseFolder = (\strpos($operationFolderRealPath, $this->baseFolderRealPath) === 0); if (!$isInBaseFolder) { throw new IOException("Cannot perform I/O operation outside of the base folder: {$this->baseFolderRealPath}"); } diff --git a/lib/Spout/Common/Helper/GlobalFunctionsHelper.php b/lib/Spout/Common/Helper/GlobalFunctionsHelper.php index 0b5f6f18421b3595ea8b870d473cce9e7c068c2e..5deb8d93f263122e5cf93f5fafe2a9a81e77b4c1 100644 --- a/lib/Spout/Common/Helper/GlobalFunctionsHelper.php +++ b/lib/Spout/Common/Helper/GlobalFunctionsHelper.php @@ -20,7 +20,7 @@ class GlobalFunctionsHelper */ public function fopen($fileName, $mode) { - return fopen($fileName, $mode); + return \fopen($fileName, $mode); } /** @@ -33,7 +33,7 @@ class GlobalFunctionsHelper */ public function fgets($handle, $length = null) { - return fgets($handle, $length); + return \fgets($handle, $length); } /** @@ -46,7 +46,7 @@ class GlobalFunctionsHelper */ public function fputs($handle, $string) { - return fputs($handle, $string); + return \fputs($handle, $string); } /** @@ -58,7 +58,7 @@ class GlobalFunctionsHelper */ public function fflush($handle) { - return fflush($handle); + return \fflush($handle); } /** @@ -71,7 +71,7 @@ class GlobalFunctionsHelper */ public function fseek($handle, $offset) { - return fseek($handle, $offset); + return \fseek($handle, $offset); } /** @@ -90,9 +90,9 @@ class GlobalFunctionsHelper // To fix that, simply disable the escape character. // @see https://bugs.php.net/bug.php?id=43225 // @see http://tools.ietf.org/html/rfc4180 - $escapeCharacter = "\0"; + $escapeCharacter = PHP_VERSION_ID >= 70400 ? '' : "\0"; - return fgetcsv($handle, $length, $delimiter, $enclosure, $escapeCharacter); + return \fgetcsv($handle, $length, $delimiter, $enclosure, $escapeCharacter); } /** @@ -111,9 +111,9 @@ class GlobalFunctionsHelper // To fix that, simply disable the escape character. // @see https://bugs.php.net/bug.php?id=43225 // @see http://tools.ietf.org/html/rfc4180 - $escapeCharacter = "\0"; + $escapeCharacter = PHP_VERSION_ID >= 70400 ? '' : "\0"; - return fputcsv($handle, $fields, $delimiter, $enclosure, $escapeCharacter); + return \fputcsv($handle, $fields, $delimiter, $enclosure, $escapeCharacter); } /** @@ -126,7 +126,7 @@ class GlobalFunctionsHelper */ public function fwrite($handle, $string) { - return fwrite($handle, $string); + return \fwrite($handle, $string); } /** @@ -138,7 +138,7 @@ class GlobalFunctionsHelper */ public function fclose($handle) { - return fclose($handle); + return \fclose($handle); } /** @@ -150,7 +150,7 @@ class GlobalFunctionsHelper */ public function rewind($handle) { - return rewind($handle); + return \rewind($handle); } /** @@ -162,7 +162,7 @@ class GlobalFunctionsHelper */ public function file_exists($fileName) { - return file_exists($fileName); + return \file_exists($fileName); } /** @@ -176,7 +176,7 @@ class GlobalFunctionsHelper { $realFilePath = $this->convertToUseRealPath($filePath); - return file_get_contents($realFilePath); + return \file_get_contents($realFilePath); } /** @@ -191,13 +191,13 @@ class GlobalFunctionsHelper $realFilePath = $filePath; if ($this->isZipStream($filePath)) { - if (preg_match('/zip:\/\/(.*)#(.*)/', $filePath, $matches)) { + if (\preg_match('/zip:\/\/(.*)#(.*)/', $filePath, $matches)) { $documentPath = $matches[1]; $documentInsideZipPath = $matches[2]; - $realFilePath = 'zip://' . realpath($documentPath) . '#' . $documentInsideZipPath; + $realFilePath = 'zip://' . \realpath($documentPath) . '#' . $documentInsideZipPath; } } else { - $realFilePath = realpath($filePath); + $realFilePath = \realpath($filePath); } return $realFilePath; @@ -211,7 +211,7 @@ class GlobalFunctionsHelper */ protected function isZipStream($path) { - return (strpos($path, 'zip://') === 0); + return (\strpos($path, 'zip://') === 0); } /** @@ -223,7 +223,7 @@ class GlobalFunctionsHelper */ public function feof($handle) { - return feof($handle); + return \feof($handle); } /** @@ -235,7 +235,7 @@ class GlobalFunctionsHelper */ public function is_readable($fileName) { - return is_readable($fileName); + return \is_readable($fileName); } /** @@ -248,7 +248,7 @@ class GlobalFunctionsHelper */ public function basename($path, $suffix = null) { - return basename($path, $suffix); + return \basename($path, $suffix); } /** @@ -260,7 +260,7 @@ class GlobalFunctionsHelper */ public function header($string) { - header($string); + \header($string); } /** @@ -271,8 +271,8 @@ class GlobalFunctionsHelper */ public function ob_end_clean() { - if (ob_get_length() > 0) { - ob_end_clean(); + if (\ob_get_length() > 0) { + \ob_end_clean(); } } @@ -287,7 +287,7 @@ class GlobalFunctionsHelper */ public function iconv($string, $sourceEncoding, $targetEncoding) { - return iconv($sourceEncoding, $targetEncoding, $string); + return \iconv($sourceEncoding, $targetEncoding, $string); } /** @@ -301,7 +301,7 @@ class GlobalFunctionsHelper */ public function mb_convert_encoding($string, $sourceEncoding, $targetEncoding) { - return mb_convert_encoding($string, $targetEncoding, $sourceEncoding); + return \mb_convert_encoding($string, $targetEncoding, $sourceEncoding); } /** @@ -312,7 +312,7 @@ class GlobalFunctionsHelper */ public function stream_get_wrappers() { - return stream_get_wrappers(); + return \stream_get_wrappers(); } /** @@ -324,6 +324,6 @@ class GlobalFunctionsHelper */ public function function_exists($functionName) { - return function_exists($functionName); + return \function_exists($functionName); } } diff --git a/lib/Spout/Common/Helper/StringHelper.php b/lib/Spout/Common/Helper/StringHelper.php index c698815f081c0c353b7008340b7f8d5bc2cb522d..09061329d82b1ab20c38c15ae5376548e90260ae 100644 --- a/lib/Spout/Common/Helper/StringHelper.php +++ b/lib/Spout/Common/Helper/StringHelper.php @@ -18,7 +18,7 @@ class StringHelper */ public function __construct() { - $this->hasMbstringSupport = extension_loaded('mbstring'); + $this->hasMbstringSupport = \extension_loaded('mbstring'); } /** @@ -32,7 +32,7 @@ class StringHelper */ public function getStringLength($string) { - return $this->hasMbstringSupport ? mb_strlen($string) : strlen($string); + return $this->hasMbstringSupport ? \mb_strlen($string) : \strlen($string); } /** @@ -47,7 +47,7 @@ class StringHelper */ public function getCharFirstOccurrencePosition($char, $string) { - $position = $this->hasMbstringSupport ? mb_strpos($string, $char) : strpos($string, $char); + $position = $this->hasMbstringSupport ? \mb_strpos($string, $char) : \strpos($string, $char); return ($position !== false) ? $position : -1; } @@ -64,7 +64,7 @@ class StringHelper */ public function getCharLastOccurrencePosition($char, $string) { - $position = $this->hasMbstringSupport ? mb_strrpos($string, $char) : strrpos($string, $char); + $position = $this->hasMbstringSupport ? \mb_strrpos($string, $char) : \strrpos($string, $char); return ($position !== false) ? $position : -1; } diff --git a/lib/Spout/Reader/CSV/Reader.php b/lib/Spout/Reader/CSV/Reader.php index 77249c162218a94a67aa193960dd837528515b40..ca61ef2e2f190a1e1746e7e0b59095dc729775a3 100644 --- a/lib/Spout/Reader/CSV/Reader.php +++ b/lib/Spout/Reader/CSV/Reader.php @@ -84,8 +84,8 @@ class Reader extends ReaderAbstract */ protected function openReader($filePath) { - $this->originalAutoDetectLineEndings = ini_get('auto_detect_line_endings'); - ini_set('auto_detect_line_endings', '1'); + $this->originalAutoDetectLineEndings = \ini_get('auto_detect_line_endings'); + \ini_set('auto_detect_line_endings', '1'); $this->filePointer = $this->globalFunctionsHelper->fopen($filePath, 'r'); if (!$this->filePointer) { @@ -123,6 +123,6 @@ class Reader extends ReaderAbstract $this->globalFunctionsHelper->fclose($this->filePointer); } - ini_set('auto_detect_line_endings', $this->originalAutoDetectLineEndings); + \ini_set('auto_detect_line_endings', $this->originalAutoDetectLineEndings); } } diff --git a/lib/Spout/Reader/CSV/RowIterator.php b/lib/Spout/Reader/CSV/RowIterator.php index bec30723b81a9ff54a78282788fd11843c4e1c47..78e66501320275851d6383d00d183dc18a1597e8 100644 --- a/lib/Spout/Reader/CSV/RowIterator.php +++ b/lib/Spout/Reader/CSV/RowIterator.php @@ -147,7 +147,7 @@ class RowIterator implements IteratorInterface if ($rowData !== false) { // str_replace will replace NULL values by empty strings - $rowDataBufferAsArray = str_replace(null, null, $rowData); + $rowDataBufferAsArray = \str_replace(null, null, $rowData); $this->rowBuffer = $this->entityFactory->createRowFromArray($rowDataBufferAsArray); $this->numReadRows++; } else { @@ -193,13 +193,13 @@ class RowIterator implements IteratorInterface case EncodingHelper::ENCODING_UTF16_LE: case EncodingHelper::ENCODING_UTF32_LE: // remove whitespace from the beginning of a string as fgetcsv() add extra whitespace when it try to explode non UTF-8 data - $cellValue = ltrim($cellValue); + $cellValue = \ltrim($cellValue); break; case EncodingHelper::ENCODING_UTF16_BE: case EncodingHelper::ENCODING_UTF32_BE: // remove whitespace from the end of a string as fgetcsv() add extra whitespace when it try to explode non UTF-8 data - $cellValue = rtrim($cellValue); + $cellValue = \rtrim($cellValue); break; } @@ -215,7 +215,7 @@ class RowIterator implements IteratorInterface */ protected function isEmptyLine($lineData) { - return (is_array($lineData) && count($lineData) === 1 && $lineData[0] === null); + return (\is_array($lineData) && \count($lineData) === 1 && $lineData[0] === null); } /** diff --git a/lib/Spout/Reader/Common/XMLProcessor.php b/lib/Spout/Reader/Common/XMLProcessor.php index 3b2d8481821db9ac5bac64644862f002042335e6..05ee970b57cdc003bd701d231d82c12579714a95 100644 --- a/lib/Spout/Reader/Common/XMLProcessor.php +++ b/lib/Spout/Reader/Common/XMLProcessor.php @@ -73,7 +73,7 @@ class XMLProcessor { $callbackObject = $callback[0]; $callbackMethodName = $callback[1]; - $reflectionMethod = new \ReflectionMethod(get_class($callbackObject), $callbackMethodName); + $reflectionMethod = new \ReflectionMethod(\get_class($callbackObject), $callbackMethodName); $reflectionMethod->setAccessible(true); return [ diff --git a/lib/Spout/Reader/ODS/Helper/CellValueFormatter.php b/lib/Spout/Reader/ODS/Helper/CellValueFormatter.php index 50209ec2f775375c915fa0aa78f690daebebfc77..168770f105baeb5bd4ff643a73b1caeecbba17a7 100644 --- a/lib/Spout/Reader/ODS/Helper/CellValueFormatter.php +++ b/lib/Spout/Reader/ODS/Helper/CellValueFormatter.php @@ -22,9 +22,11 @@ class CellValueFormatter /** Definition of XML nodes names used to parse data */ const XML_NODE_P = 'p'; - const XML_NODE_S = 'text:s'; - const XML_NODE_A = 'text:a'; - const XML_NODE_SPAN = 'text:span'; + const XML_NODE_TEXT_A = 'text:a'; + const XML_NODE_TEXT_SPAN = 'text:span'; + const XML_NODE_TEXT_S = 'text:s'; + const XML_NODE_TEXT_TAB = 'text:tab'; + const XML_NODE_TEXT_LINE_BREAK = 'text:line-break'; /** Definition of XML attributes used to parse data */ const XML_ATTRIBUTE_TYPE = 'office:value-type'; @@ -41,6 +43,13 @@ class CellValueFormatter /** @var \Box\Spout\Common\Helper\Escaper\ODS Used to unescape XML data */ protected $escaper; + /** @var array List of XML nodes representing whitespaces and their corresponding value */ + private static $WHITESPACE_XML_NODES = [ + self::XML_NODE_TEXT_S => ' ', + self::XML_NODE_TEXT_TAB => "\t", + self::XML_NODE_TEXT_LINE_BREAK => "\n", + ]; + /** * @param bool $shouldFormatDates Whether date/time values should be returned as PHP objects or be formatted as strings * @param \Box\Spout\Common\Helper\Escaper\ODS $escaper Used to unescape XML data @@ -96,29 +105,71 @@ class CellValueFormatter $pNodes = $node->getElementsByTagName(self::XML_NODE_P); foreach ($pNodes as $pNode) { - $currentPValue = ''; - - foreach ($pNode->childNodes as $childNode) { - if ($childNode instanceof \DOMText) { - $currentPValue .= $childNode->nodeValue; - } elseif ($childNode->nodeName === self::XML_NODE_S) { - $spaceAttribute = $childNode->getAttribute(self::XML_ATTRIBUTE_C); - $numSpaces = (!empty($spaceAttribute)) ? (int) $spaceAttribute : 1; - $currentPValue .= str_repeat(' ', $numSpaces); - } elseif ($childNode->nodeName === self::XML_NODE_A || $childNode->nodeName === self::XML_NODE_SPAN) { - $currentPValue .= $childNode->nodeValue; - } - } - - $pNodeValues[] = $currentPValue; + $pNodeValues[] = $this->extractTextValueFromNode($pNode); } - $escapedCellValue = implode("\n", $pNodeValues); + $escapedCellValue = \implode("\n", $pNodeValues); $cellValue = $this->escaper->unescape($escapedCellValue); return $cellValue; } + /** + * @param $pNode + * @return string + */ + private function extractTextValueFromNode($pNode) + { + $textValue = ''; + + foreach ($pNode->childNodes as $childNode) { + if ($childNode instanceof \DOMText) { + $textValue .= $childNode->nodeValue; + } elseif ($this->isWhitespaceNode($childNode->nodeName)) { + $textValue .= $this->transformWhitespaceNode($childNode); + } elseif ($childNode->nodeName === self::XML_NODE_TEXT_A || $childNode->nodeName === self::XML_NODE_TEXT_SPAN) { + $textValue .= $this->extractTextValueFromNode($childNode); + } + } + + return $textValue; + } + + /** + * Returns whether the given node is a whitespace node. It must be one of these: + * - <text:s /> + * - <text:tab /> + * - <text:line-break /> + * + * @param string $nodeName + * @return bool + */ + private function isWhitespaceNode($nodeName) + { + return isset(self::$WHITESPACE_XML_NODES[$nodeName]); + } + + /** + * The "<text:p>" node can contain the string value directly + * or contain child elements. In this case, whitespaces contain in + * the child elements should be replaced by their XML equivalent: + * - space => <text:s /> + * - tab => <text:tab /> + * - line break => <text:line-break /> + * + * @see https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415200_253892949 + * + * @param \DOMNode $node The XML node representing a whitespace + * @return string The corresponding whitespace value + */ + private function transformWhitespaceNode($node) + { + $countAttribute = $node->getAttribute(self::XML_ATTRIBUTE_C); // only defined for "<text:s>" + $numWhitespaces = (!empty($countAttribute)) ? (int) $countAttribute : 1; + + return \str_repeat(self::$WHITESPACE_XML_NODES[$node->nodeName], $numWhitespaces); + } + /** * Returns the cell Numeric value from the given node. * diff --git a/lib/Spout/Reader/Wrapper/XMLInternalErrorsHelper.php b/lib/Spout/Reader/Wrapper/XMLInternalErrorsHelper.php index 7047a9475cbbadb840e1875bdc7bd0d5ed85ec3d..ecf0dbd06842ef9971f54d3c78b691c8dc6ed7e1 100644 --- a/lib/Spout/Reader/Wrapper/XMLInternalErrorsHelper.php +++ b/lib/Spout/Reader/Wrapper/XMLInternalErrorsHelper.php @@ -20,8 +20,8 @@ trait XMLInternalErrorsHelper */ protected function useXMLInternalErrors() { - libxml_clear_errors(); - $this->initialUseInternalErrorsValue = libxml_use_internal_errors(true); + \libxml_clear_errors(); + $this->initialUseInternalErrorsValue = \libxml_use_internal_errors(true); } /** @@ -48,7 +48,7 @@ trait XMLInternalErrorsHelper */ private function hasXMLErrorOccured() { - return (libxml_get_last_error() !== false); + return (\libxml_get_last_error() !== false); } /** @@ -60,10 +60,10 @@ trait XMLInternalErrorsHelper private function getLastXMLErrorMessage() { $errorMessage = null; - $error = libxml_get_last_error(); + $error = \libxml_get_last_error(); if ($error !== false) { - $errorMessage = trim($error->message); + $errorMessage = \trim($error->message); } return $errorMessage; @@ -74,6 +74,6 @@ trait XMLInternalErrorsHelper */ protected function resetXMLInternalErrorsSetting() { - libxml_use_internal_errors($this->initialUseInternalErrorsValue); + \libxml_use_internal_errors($this->initialUseInternalErrorsValue); } } diff --git a/lib/Spout/Reader/Wrapper/XMLReader.php b/lib/Spout/Reader/Wrapper/XMLReader.php index bdbaf4d1764bc5534cceaa74949e3cfe9d85c8d8..6f85f320c8ff7dec6635c44d469f742e1644b1ad 100644 --- a/lib/Spout/Reader/Wrapper/XMLReader.php +++ b/lib/Spout/Reader/Wrapper/XMLReader.php @@ -46,9 +46,9 @@ class XMLReader extends \XMLReader public function getRealPathURIForFileInZip($zipFilePath, $fileInsideZipPath) { // The file path should not start with a '/', otherwise it won't be found - $fileInsideZipPathWithoutLeadingSlash = ltrim($fileInsideZipPath, '/'); + $fileInsideZipPathWithoutLeadingSlash = \ltrim($fileInsideZipPath, '/'); - return (self::ZIP_WRAPPER . realpath($zipFilePath) . '#' . $fileInsideZipPathWithoutLeadingSlash); + return (self::ZIP_WRAPPER . \realpath($zipFilePath) . '#' . $fileInsideZipPathWithoutLeadingSlash); } /** @@ -62,7 +62,7 @@ class XMLReader extends \XMLReader $doesFileExists = false; $pattern = '/zip:\/\/([^#]+)#(.*)/'; - if (preg_match($pattern, $zipStreamURI, $matches)) { + if (\preg_match($pattern, $zipStreamURI, $matches)) { $zipFilePath = $matches[1]; $innerFilePath = $matches[2]; @@ -158,7 +158,7 @@ class XMLReader extends \XMLReader // In some cases, the node has a prefix (for instance, "<sheet>" can also be "<x:sheet>"). // So if the given node name does not have a prefix, we need to look at the unprefixed name ("localName"). // @see https://github.com/box/spout/issues/233 - $hasPrefix = (strpos($nodeName, ':') !== false); + $hasPrefix = (\strpos($nodeName, ':') !== false); $currentNodeName = ($hasPrefix) ? $this->name : $this->localName; return ($this->nodeType === $nodeType && $currentNodeName === $nodeName); diff --git a/lib/Spout/Reader/XLSX/Helper/CellHelper.php b/lib/Spout/Reader/XLSX/Helper/CellHelper.php index 27b5abfa28913d50cdf63d46f69820b09387eb18..d970189e6532737c6ad40788fc9cbfe87437d6ff 100644 --- a/lib/Spout/Reader/XLSX/Helper/CellHelper.php +++ b/lib/Spout/Reader/XLSX/Helper/CellHelper.php @@ -37,7 +37,7 @@ class CellHelper $columnIndex = 0; // Remove row information - $columnLetters = preg_replace('/\d/', '', $cellIndex); + $columnLetters = \preg_replace('/\d/', '', $cellIndex); // strlen() is super slow too... Using isset() is way faster and not too unreadable, // since we checked before that there are between 1 and 3 letters. @@ -75,6 +75,6 @@ class CellHelper */ protected static function isValidCellIndex($cellIndex) { - return (preg_match('/^[A-Z]{1,3}\d+$/', $cellIndex) === 1); + return (\preg_match('/^[A-Z]{1,3}\d+$/', $cellIndex) === 1); } } diff --git a/lib/Spout/Reader/XLSX/Helper/CellValueFormatter.php b/lib/Spout/Reader/XLSX/Helper/CellValueFormatter.php index fba36b13ec0988e2fe73ebee89759a6c60722a62..169c395be1467f5c05a525325a26432b9c64a384 100644 --- a/lib/Spout/Reader/XLSX/Helper/CellValueFormatter.php +++ b/lib/Spout/Reader/XLSX/Helper/CellValueFormatter.php @@ -163,7 +163,7 @@ class CellValueFormatter */ protected function formatStrCellValue($nodeValue) { - $escapedCellValue = trim($nodeValue); + $escapedCellValue = \trim($nodeValue); $cellValue = $this->escaper->unescape($escapedCellValue); return $cellValue; @@ -248,8 +248,8 @@ class CellValueFormatter $baseDate = $this->shouldUse1904Dates ? '1904-01-01' : '1899-12-30'; $daysSinceBaseDate = (int) $nodeValue; - $timeRemainder = fmod($nodeValue, 1); - $secondsRemainder = round($timeRemainder * self::NUM_SECONDS_IN_ONE_DAY, 0); + $timeRemainder = \fmod($nodeValue, 1); + $secondsRemainder = \round($timeRemainder * self::NUM_SECONDS_IN_ONE_DAY, 0); $dateObj = \DateTime::createFromFormat('|Y-m-d', $baseDate); $dateObj->modify('+' . $daysSinceBaseDate . 'days'); diff --git a/lib/Spout/Reader/XLSX/Helper/DateFormatHelper.php b/lib/Spout/Reader/XLSX/Helper/DateFormatHelper.php index 1618af761451d1ee458316e76072cd272d7ae323..443578819412da3d40d2a62b4df83642c33807a7 100644 --- a/lib/Spout/Reader/XLSX/Helper/DateFormatHelper.php +++ b/lib/Spout/Reader/XLSX/Helper/DateFormatHelper.php @@ -62,13 +62,13 @@ class DateFormatHelper // Remove brackets potentially present at the beginning of the format string // and text portion of the format at the end of it (starting with ";") // See §18.8.31 of ECMA-376 for more detail. - $dateFormat = preg_replace('/^(?:\[\$[^\]]+?\])?([^;]*).*/', '$1', $excelDateFormat); + $dateFormat = \preg_replace('/^(?:\[\$[^\]]+?\])?([^;]*).*/', '$1', $excelDateFormat); // Double quotes are used to escape characters that must not be interpreted. // For instance, ["Day " dd] should result in "Day 13" and we should not try to interpret "D", "a", "y" // By exploding the format string using double quote as a delimiter, we can get all parts // that must be transformed (even indexes) and all parts that must not be (odd indexes). - $dateFormatParts = explode('"', $dateFormat); + $dateFormatParts = \explode('"', $dateFormat); foreach ($dateFormatParts as $partIndex => $dateFormatPart) { // do not look at odd indexes @@ -77,19 +77,19 @@ class DateFormatHelper } // Make sure all characters are lowercase, as the mapping table is using lowercase characters - $transformedPart = strtolower($dateFormatPart); + $transformedPart = \strtolower($dateFormatPart); // Remove escapes related to non-format characters - $transformedPart = str_replace('\\', '', $transformedPart); + $transformedPart = \str_replace('\\', '', $transformedPart); // Apply general transformation first... - $transformedPart = strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_GENERAL]); + $transformedPart = \strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_GENERAL]); // ... then apply hour transformation, for 12-hour or 24-hour format if (self::has12HourFormatMarker($dateFormatPart)) { - $transformedPart = strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_HOUR_12]); + $transformedPart = \strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_HOUR_12]); } else { - $transformedPart = strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_HOUR_24]); + $transformedPart = \strtr($transformedPart, self::$excelDateFormatToPHPDateFormatMapping[self::KEY_HOUR_24]); } // overwrite the parts array with the new transformed part @@ -97,16 +97,16 @@ class DateFormatHelper } // Merge all transformed parts back together - $phpDateFormat = implode('"', $dateFormatParts); + $phpDateFormat = \implode('"', $dateFormatParts); // Finally, to have the date format compatible with the DateTime::format() function, we need to escape // all characters that are inside double quotes (and double quotes must be removed). // For instance, ["Day " dd] should become [\D\a\y\ dd] - $phpDateFormat = preg_replace_callback('/"(.+?)"/', function ($matches) { + $phpDateFormat = \preg_replace_callback('/"(.+?)"/', function ($matches) { $stringToEscape = $matches[1]; - $letters = preg_split('//u', $stringToEscape, -1, PREG_SPLIT_NO_EMPTY); + $letters = \preg_split('//u', $stringToEscape, -1, PREG_SPLIT_NO_EMPTY); - return '\\' . implode('\\', $letters); + return '\\' . \implode('\\', $letters); }, $phpDateFormat); return $phpDateFormat; @@ -118,6 +118,6 @@ class DateFormatHelper */ private static function has12HourFormatMarker($excelDateFormat) { - return (stripos($excelDateFormat, 'am/pm') !== false); + return (\stripos($excelDateFormat, 'am/pm') !== false); } } diff --git a/lib/Spout/Reader/XLSX/RowIterator.php b/lib/Spout/Reader/XLSX/RowIterator.php index f16142584730178cc4366c2e931302e1f01a99d4..4af4530d9363151b0432e0e371521830fd820069 100644 --- a/lib/Spout/Reader/XLSX/RowIterator.php +++ b/lib/Spout/Reader/XLSX/RowIterator.php @@ -127,7 +127,7 @@ class RowIterator implements IteratorInterface */ protected function normalizeSheetDataXMLFilePath($sheetDataXMLFilePath) { - return ltrim($sheetDataXMLFilePath, '/'); + return \ltrim($sheetDataXMLFilePath, '/'); } /** @@ -234,7 +234,7 @@ class RowIterator implements IteratorInterface { // Read dimensions of the sheet $dimensionRef = $xmlReader->getAttribute(self::XML_ATTRIBUTE_REF); // returns 'A1:M13' for instance (or 'A1' for empty sheet) - if (preg_match('/[A-Z]+\d+:([A-Z]+\d+)/', $dimensionRef, $matches)) { + if (\preg_match('/[A-Z]+\d+:([A-Z]+\d+)/', $dimensionRef, $matches)) { $this->numColumns = CellHelper::getColumnIndexFromCellIndex($matches[1]) + 1; } @@ -257,11 +257,11 @@ class RowIterator implements IteratorInterface $numberOfColumnsForRow = $this->numColumns; $spans = $xmlReader->getAttribute(self::XML_ATTRIBUTE_SPANS); // returns '1:5' for instance if ($spans) { - list(, $numberOfColumnsForRow) = explode(':', $spans); + list(, $numberOfColumnsForRow) = \explode(':', $spans); $numberOfColumnsForRow = (int) $numberOfColumnsForRow; } - $cells = array_fill(0, $numberOfColumnsForRow, $this->entityFactory->createCell('')); + $cells = \array_fill(0, $numberOfColumnsForRow, $this->entityFactory->createCell('')); $this->currentlyProcessedRow->setCells($cells); return XMLProcessor::PROCESSING_CONTINUE; diff --git a/lib/Spout/Reader/XLSX/SheetIterator.php b/lib/Spout/Reader/XLSX/SheetIterator.php index d9ed17c79d0216eac5a6caebc46645025c8f13f5..81f481c3cdca0253eef56292747e5d01397b27de 100644 --- a/lib/Spout/Reader/XLSX/SheetIterator.php +++ b/lib/Spout/Reader/XLSX/SheetIterator.php @@ -27,7 +27,7 @@ class SheetIterator implements IteratorInterface // Fetch all available sheets $this->sheets = $sheetManager->getSheets(); - if (count($this->sheets) === 0) { + if (\count($this->sheets) === 0) { throw new NoSheetsFoundException('The file must contain at least one sheet.'); } } @@ -51,7 +51,7 @@ class SheetIterator implements IteratorInterface */ public function valid() { - return ($this->currentSheetIndex < count($this->sheets)); + return ($this->currentSheetIndex < \count($this->sheets)); } /** diff --git a/lib/Spout/Writer/Common/Helper/CellHelper.php b/lib/Spout/Writer/Common/Helper/CellHelper.php index 472d310fa9fd7c551c4a98e0da39629ad65f9ed4..afe3c712609b9dee8ba733214f901f14535f47fb 100644 --- a/lib/Spout/Writer/Common/Helper/CellHelper.php +++ b/lib/Spout/Writer/Common/Helper/CellHelper.php @@ -8,38 +8,39 @@ namespace Box\Spout\Writer\Common\Helper; */ class CellHelper { - /** @var array Cache containing the mapping column index => cell index */ - private static $columnIndexToCellIndexCache = []; + /** @var array Cache containing the mapping column index => column letters */ + private static $columnIndexToColumnLettersCache = []; /** - * Returns the cell index (base 26) associated to the base 10 column index. + * Returns the column letters (base 26) associated to the base 10 column index. * Excel uses A to Z letters for column indexing, where A is the 1st column, * Z is the 26th and AA is the 27th. * The mapping is zero based, so that 0 maps to A, B maps to 1, Z to 25 and AA to 26. * - * @param int $columnIndex The Excel column index (0, 42, ...) + * @param int $columnIndexZeroBased The Excel column index (0, 42, ...) + * * @return string The associated cell index ('A', 'BC', ...) */ - public static function getCellIndexFromColumnIndex($columnIndex) + public static function getColumnLettersFromColumnIndex($columnIndexZeroBased) { - $originalColumnIndex = $columnIndex; + $originalColumnIndex = $columnIndexZeroBased; // Using isset here because it is way faster than array_key_exists... - if (!isset(self::$columnIndexToCellIndexCache[$originalColumnIndex])) { - $cellIndex = ''; - $capitalAAsciiValue = ord('A'); + if (!isset(self::$columnIndexToColumnLettersCache[$originalColumnIndex])) { + $columnLetters = ''; + $capitalAAsciiValue = \ord('A'); do { - $modulus = $columnIndex % 26; - $cellIndex = chr($capitalAAsciiValue + $modulus) . $cellIndex; + $modulus = $columnIndexZeroBased % 26; + $columnLetters = \chr($capitalAAsciiValue + $modulus) . $columnLetters; // substracting 1 because it's zero-based - $columnIndex = (int) ($columnIndex / 26) - 1; - } while ($columnIndex >= 0); + $columnIndexZeroBased = (int) ($columnIndexZeroBased / 26) - 1; + } while ($columnIndexZeroBased >= 0); - self::$columnIndexToCellIndexCache[$originalColumnIndex] = $cellIndex; + self::$columnIndexToColumnLettersCache[$originalColumnIndex] = $columnLetters; } - return self::$columnIndexToCellIndexCache[$originalColumnIndex]; + return self::$columnIndexToColumnLettersCache[$originalColumnIndex]; } } diff --git a/lib/Spout/Writer/Common/Helper/ZipHelper.php b/lib/Spout/Writer/Common/Helper/ZipHelper.php index b8fcd6c1c5eff417c55339e494f5142ac9de8d3e..7a250c86a0be4d71fb780e5d969289e3153d72f9 100644 --- a/lib/Spout/Writer/Common/Helper/ZipHelper.php +++ b/lib/Spout/Writer/Common/Helper/ZipHelper.php @@ -135,7 +135,7 @@ class ZipHelper public static function canChooseCompressionMethod() { // setCompressionName() is a PHP7+ method... - return (method_exists(new \ZipArchive(), 'setCompressionName')); + return (\method_exists(new \ZipArchive(), 'setCompressionName')); } /** @@ -151,7 +151,7 @@ class ZipHelper foreach ($itemIterator as $itemInfo) { $itemRealPath = $this->getNormalizedRealPath($itemInfo->getPathname()); - $itemLocalPath = str_replace($folderRealPath, '', $itemRealPath); + $itemLocalPath = \str_replace($folderRealPath, '', $itemRealPath); if ($itemInfo->isFile() && !$this->shouldSkipFile($zip, $itemLocalPath, $existingFileMode)) { $zip->addFile($itemRealPath, $itemLocalPath); @@ -181,9 +181,9 @@ class ZipHelper */ protected function getNormalizedRealPath($path) { - $realPath = realpath($path); + $realPath = \realpath($path); - return str_replace(DIRECTORY_SEPARATOR, '/', $realPath); + return \str_replace(DIRECTORY_SEPARATOR, '/', $realPath); } /** @@ -210,8 +210,8 @@ class ZipHelper */ protected function copyZipToStream($zipFilePath, $pointer) { - $zipFilePointer = fopen($zipFilePath, 'r'); - stream_copy_to_stream($zipFilePointer, $pointer); - fclose($zipFilePointer); + $zipFilePointer = \fopen($zipFilePath, 'r'); + \stream_copy_to_stream($zipFilePointer, $pointer); + \fclose($zipFilePointer); } } diff --git a/lib/Spout/Writer/Exception/Border/InvalidNameException.php b/lib/Spout/Writer/Exception/Border/InvalidNameException.php index 8bedc3854b6bf617d4fe9c4edb4d5abf77af35b2..c975d4fc4830a8fba4d32bc7518969df4f144b02 100644 --- a/lib/Spout/Writer/Exception/Border/InvalidNameException.php +++ b/lib/Spout/Writer/Exception/Border/InvalidNameException.php @@ -11,6 +11,6 @@ class InvalidNameException extends WriterException { $msg = '%s is not a valid name identifier for a border. Valid identifiers are: %s.'; - parent::__construct(sprintf($msg, $name, implode(',', BorderPart::getAllowedNames()))); + parent::__construct(\sprintf($msg, $name, \implode(',', BorderPart::getAllowedNames()))); } } diff --git a/lib/Spout/Writer/Exception/Border/InvalidStyleException.php b/lib/Spout/Writer/Exception/Border/InvalidStyleException.php index e4bb145f61a39a4d1e261ad327a708fc7c5449a2..2d1d78c86d6cebce7d5e7d34803b49ae98409458 100644 --- a/lib/Spout/Writer/Exception/Border/InvalidStyleException.php +++ b/lib/Spout/Writer/Exception/Border/InvalidStyleException.php @@ -11,6 +11,6 @@ class InvalidStyleException extends WriterException { $msg = '%s is not a valid style identifier for a border. Valid identifiers are: %s.'; - parent::__construct(sprintf($msg, $name, implode(',', BorderPart::getAllowedStyles()))); + parent::__construct(\sprintf($msg, $name, \implode(',', BorderPart::getAllowedStyles()))); } } diff --git a/lib/Spout/Writer/Exception/Border/InvalidWidthException.php b/lib/Spout/Writer/Exception/Border/InvalidWidthException.php index f38d8980ea1d39e8df272561a8fc05bd89595a72..790ddc2cb510a182737f2ca9d50f350029195fab 100644 --- a/lib/Spout/Writer/Exception/Border/InvalidWidthException.php +++ b/lib/Spout/Writer/Exception/Border/InvalidWidthException.php @@ -11,6 +11,6 @@ class InvalidWidthException extends WriterException { $msg = '%s is not a valid width identifier for a border. Valid identifiers are: %s.'; - parent::__construct(sprintf($msg, $name, implode(',', BorderPart::getAllowedWidths()))); + parent::__construct(\sprintf($msg, $name, \implode(',', BorderPart::getAllowedWidths()))); } } diff --git a/lib/Spout/Writer/ODS/Helper/BorderHelper.php b/lib/Spout/Writer/ODS/Helper/BorderHelper.php index a53f63c4aef7e732f3e30b9f4e1abdab75e94847..34886acf411c5303e9927363a732e5e7a7662629 100644 --- a/lib/Spout/Writer/ODS/Helper/BorderHelper.php +++ b/lib/Spout/Writer/ODS/Helper/BorderHelper.php @@ -53,14 +53,14 @@ class BorderHelper $definition = 'fo:border-%s="%s"'; if ($borderPart->getStyle() === Border::STYLE_NONE) { - $borderPartDefinition = sprintf($definition, $borderPart->getName(), 'none'); + $borderPartDefinition = \sprintf($definition, $borderPart->getName(), 'none'); } else { $attributes = [ self::$widthMap[$borderPart->getWidth()], self::$styleMap[$borderPart->getStyle()], '#' . $borderPart->getColor(), ]; - $borderPartDefinition = sprintf($definition, $borderPart->getName(), implode(' ', $attributes)); + $borderPartDefinition = \sprintf($definition, $borderPart->getName(), \implode(' ', $attributes)); } return $borderPartDefinition; diff --git a/lib/Spout/Writer/ODS/Helper/FileSystemHelper.php b/lib/Spout/Writer/ODS/Helper/FileSystemHelper.php index d0e2e0507e461b49ce6c5fe744c4544b86cf142e..5598bb4a55c6eb9b896eb0a5575686e8c9cbc6da 100644 --- a/lib/Spout/Writer/ODS/Helper/FileSystemHelper.php +++ b/lib/Spout/Writer/ODS/Helper/FileSystemHelper.php @@ -89,7 +89,7 @@ class FileSystemHelper extends \Box\Spout\Common\Helper\FileSystemHelper impleme */ protected function createRootFolder() { - $this->rootFolder = $this->createFolder($this->baseFolderRealPath, uniqid('ods')); + $this->rootFolder = $this->createFolder($this->baseFolderRealPath, \uniqid('ods')); return $this; } @@ -210,22 +210,22 @@ EOD; // Append sheets content to "content.xml" $contentXmlFilePath = $this->rootFolder . '/' . self::CONTENT_XML_FILE_NAME; - $contentXmlHandle = fopen($contentXmlFilePath, 'a'); + $contentXmlHandle = \fopen($contentXmlFilePath, 'a'); foreach ($worksheets as $worksheet) { // write the "<table:table>" node, with the final sheet's name - fwrite($contentXmlHandle, $worksheetManager->getTableElementStartAsString($worksheet)); + \fwrite($contentXmlHandle, $worksheetManager->getTableElementStartAsString($worksheet)); $worksheetFilePath = $worksheet->getFilePath(); $this->copyFileContentsToTarget($worksheetFilePath, $contentXmlHandle); - fwrite($contentXmlHandle, '</table:table>'); + \fwrite($contentXmlHandle, '</table:table>'); } $contentXmlFileContents = '</office:spreadsheet></office:body></office:document-content>'; - fwrite($contentXmlHandle, $contentXmlFileContents); - fclose($contentXmlHandle); + \fwrite($contentXmlHandle, $contentXmlFileContents); + \fclose($contentXmlHandle); return $this; } @@ -241,9 +241,9 @@ EOD; */ protected function copyFileContentsToTarget($sourceFilePath, $targetResource) { - $sourceHandle = fopen($sourceFilePath, 'r'); - stream_copy_to_stream($sourceHandle, $targetResource); - fclose($sourceHandle); + $sourceHandle = \fopen($sourceFilePath, 'r'); + \stream_copy_to_stream($sourceHandle, $targetResource); + \fclose($sourceHandle); } /** diff --git a/lib/Spout/Writer/XLSX/Helper/BorderHelper.php b/lib/Spout/Writer/XLSX/Helper/BorderHelper.php index 1c773fde34e95dfef8d29273b5725ec69e3f0160..ed202cb63c371b5bb70509cdb89d258052fd43b8 100644 --- a/lib/Spout/Writer/XLSX/Helper/BorderHelper.php +++ b/lib/Spout/Writer/XLSX/Helper/BorderHelper.php @@ -43,8 +43,8 @@ class BorderHelper { $borderStyle = self::getBorderStyle($borderPart); - $colorEl = $borderPart->getColor() ? sprintf('<color rgb="%s"/>', $borderPart->getColor()) : ''; - $partEl = sprintf( + $colorEl = $borderPart->getColor() ? \sprintf('<color rgb="%s"/>', $borderPart->getColor()) : ''; + $partEl = \sprintf( '<%s style="%s">%s</%s>', $borderPart->getName(), $borderStyle, diff --git a/lib/Spout/Writer/XLSX/Helper/FileSystemHelper.php b/lib/Spout/Writer/XLSX/Helper/FileSystemHelper.php index 8997b98cc2d006a87b1194e06858010d87ac8244..0a19d9ed84234ced9594b790166f71b0f6709f9b 100644 --- a/lib/Spout/Writer/XLSX/Helper/FileSystemHelper.php +++ b/lib/Spout/Writer/XLSX/Helper/FileSystemHelper.php @@ -112,7 +112,7 @@ class FileSystemHelper extends \Box\Spout\Common\Helper\FileSystemHelper impleme */ private function createRootFolder() { - $this->rootFolder = $this->createFolder($this->baseFolderRealPath, uniqid('xlsx', true)); + $this->rootFolder = $this->createFolder($this->baseFolderRealPath, \uniqid('xlsx', true)); return $this; } diff --git a/lib/Spout/version.txt b/lib/Spout/version.txt index 25213ca686ecb9a72ac37f8b4a5f8c3df9fc1073..46d0eef9715f32c7151be4143edfeba45797f65c 100644 --- a/lib/Spout/version.txt +++ b/lib/Spout/version.txt @@ -1,4 +1,4 @@ Doc : http://opensource.box.com/spout/ Download : https://github.com/box/spout/releases -Version 3.0.1 \ No newline at end of file +Version 3.1.0 \ No newline at end of file diff --git a/paquet.xml b/paquet.xml index fd9a0d9243f45870aebdbfc90688717b907712cf..3d14d57c2cce16fe4009c0edef611354e507c823 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@ <paquet prefix="soyezcreateurs" categorie="squelette" - version="5.0.91" + version="5.0.92" etat="stable" compatibilite="[3.1.8;3.2.*]" logo="img_pack/soyezcreateurs_48.png"