Need to support PHP5.3 for a client unfortunately
This commit is contained in:
parent
6eef69634b
commit
31482fc622
@ -58,8 +58,8 @@ class XLSX implements EscaperInterface
|
|||||||
*/
|
*/
|
||||||
protected function getControlCharactersEscapingMap()
|
protected function getControlCharactersEscapingMap()
|
||||||
{
|
{
|
||||||
$controlCharactersEscapingMap = [];
|
$controlCharactersEscapingMap = array();
|
||||||
$whitelistedControlCharacters = ["\t", "\r", "\n"];
|
$whitelistedControlCharacters = array("\t", "\r", "\n");
|
||||||
|
|
||||||
// control characters values are from 0 to 1F (hex values) in the ASCII table
|
// control characters values are from 0 to 1F (hex values) in the ASCII table
|
||||||
for ($charValue = 0x0; $charValue <= 0x1F; $charValue++) {
|
for ($charValue = 0x0; $charValue <= 0x1F; $charValue++) {
|
||||||
|
@ -145,9 +145,9 @@ class SharedStringsHelper
|
|||||||
*/
|
*/
|
||||||
protected function removeSuperfluousTextNodes($parentNode)
|
protected function removeSuperfluousTextNodes($parentNode)
|
||||||
{
|
{
|
||||||
$tagsToRemove = [
|
$tagsToRemove = array(
|
||||||
'rPh', // Pronunciation of the text
|
'rPh', // Pronunciation of the text
|
||||||
];
|
);
|
||||||
|
|
||||||
foreach ($tagsToRemove as $tagToRemove) {
|
foreach ($tagsToRemove as $tagToRemove) {
|
||||||
$xpath = '//ns:' . $tagToRemove;
|
$xpath = '//ns:' . $tagToRemove;
|
||||||
|
@ -40,7 +40,7 @@ class WorksheetHelper
|
|||||||
*/
|
*/
|
||||||
public function getWorksheets()
|
public function getWorksheets()
|
||||||
{
|
{
|
||||||
$worksheets = [];
|
$worksheets = array();
|
||||||
|
|
||||||
$xmlContents = file_get_contents('zip://' . $this->filePath . '#' . self::CONTENT_TYPES_XML_FILE_PATH);
|
$xmlContents = file_get_contents('zip://' . $this->filePath . '#' . self::CONTENT_TYPES_XML_FILE_PATH);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ class XLSX extends AbstractReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
$isInsideRowTag = false;
|
$isInsideRowTag = false;
|
||||||
$rowData = [];
|
$rowData = array();
|
||||||
|
|
||||||
while ($this->xmlReader->read()) {
|
while ($this->xmlReader->read()) {
|
||||||
if ($this->xmlReader->nodeType == \XMLReader::ELEMENT && $this->xmlReader->name === 'dimension') {
|
if ($this->xmlReader->nodeType == \XMLReader::ELEMENT && $this->xmlReader->name === 'dimension') {
|
||||||
@ -230,7 +230,7 @@ class XLSX extends AbstractReader
|
|||||||
}
|
}
|
||||||
|
|
||||||
// no data means "end of file"
|
// no data means "end of file"
|
||||||
return ($rowData !== []) ? $rowData : null;
|
return ($rowData !== array()) ? $rowData : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -179,7 +179,8 @@ EOD;
|
|||||||
*/
|
*/
|
||||||
protected function createCoreXmlFile()
|
protected function createCoreXmlFile()
|
||||||
{
|
{
|
||||||
$createdDate = (new \DateTime())->format('c');
|
$dt = new \DateTime();
|
||||||
|
$createdDate = $dt->format('c');
|
||||||
$coreXmlFileContents = <<<EOD
|
$coreXmlFileContents = <<<EOD
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
@ -36,7 +36,7 @@ class Workbook
|
|||||||
protected $sharedStringsHelper;
|
protected $sharedStringsHelper;
|
||||||
|
|
||||||
/** @var Worksheet[] Array containing the workbook's sheets */
|
/** @var Worksheet[] Array containing the workbook's sheets */
|
||||||
protected $worksheets = [];
|
protected $worksheets = array();
|
||||||
|
|
||||||
/** @var Worksheet The worksheet where data will be written to */
|
/** @var Worksheet The worksheet where data will be written to */
|
||||||
protected $currentWorksheet;
|
protected $currentWorksheet;
|
||||||
|
@ -88,7 +88,7 @@ class XLSX extends AbstractWriter
|
|||||||
{
|
{
|
||||||
$this->throwIfBookIsNotAvailable();
|
$this->throwIfBookIsNotAvailable();
|
||||||
|
|
||||||
$externalSheets = [];
|
$externalSheets = array();
|
||||||
$worksheets = $this->book->getWorksheets();
|
$worksheets = $this->book->getWorksheets();
|
||||||
|
|
||||||
/** @var Internal\XLSX\Worksheet $worksheet */
|
/** @var Internal\XLSX\Worksheet $worksheet */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user