Need to support PHP5.3 for a client unfortunately

This commit is contained in:
Chris Graham 2015-03-22 22:58:33 +00:00
parent 6eef69634b
commit 31482fc622
7 changed files with 11 additions and 10 deletions

View File

@ -58,8 +58,8 @@ class XLSX implements EscaperInterface
*/
protected function getControlCharactersEscapingMap()
{
$controlCharactersEscapingMap = [];
$whitelistedControlCharacters = ["\t", "\r", "\n"];
$controlCharactersEscapingMap = array();
$whitelistedControlCharacters = array("\t", "\r", "\n");
// control characters values are from 0 to 1F (hex values) in the ASCII table
for ($charValue = 0x0; $charValue <= 0x1F; $charValue++) {

View File

@ -145,9 +145,9 @@ class SharedStringsHelper
*/
protected function removeSuperfluousTextNodes($parentNode)
{
$tagsToRemove = [
$tagsToRemove = array(
'rPh', // Pronunciation of the text
];
);
foreach ($tagsToRemove as $tagToRemove) {
$xpath = '//ns:' . $tagToRemove;

View File

@ -40,7 +40,7 @@ class WorksheetHelper
*/
public function getWorksheets()
{
$worksheets = [];
$worksheets = array();
$xmlContents = file_get_contents('zip://' . $this->filePath . '#' . self::CONTENT_TYPES_XML_FILE_PATH);

View File

@ -185,7 +185,7 @@ class XLSX extends AbstractReader
}
$isInsideRowTag = false;
$rowData = [];
$rowData = array();
while ($this->xmlReader->read()) {
if ($this->xmlReader->nodeType == \XMLReader::ELEMENT && $this->xmlReader->name === 'dimension') {
@ -230,7 +230,7 @@ class XLSX extends AbstractReader
}
// no data means "end of file"
return ($rowData !== []) ? $rowData : null;
return ($rowData !== array()) ? $rowData : null;
}
/**

View File

@ -179,7 +179,8 @@ EOD;
*/
protected function createCoreXmlFile()
{
$createdDate = (new \DateTime())->format('c');
$dt = new \DateTime();
$createdDate = $dt->format('c');
$coreXmlFileContents = <<<EOD
<?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">

View File

@ -36,7 +36,7 @@ class Workbook
protected $sharedStringsHelper;
/** @var Worksheet[] Array containing the workbook's sheets */
protected $worksheets = [];
protected $worksheets = array();
/** @var Worksheet The worksheet where data will be written to */
protected $currentWorksheet;

View File

@ -88,7 +88,7 @@ class XLSX extends AbstractWriter
{
$this->throwIfBookIsNotAvailable();
$externalSheets = [];
$externalSheets = array();
$worksheets = $this->book->getWorksheets();
/** @var Internal\XLSX\Worksheet $worksheet */